[PATCH] D55468: Use zip_longest for iterator range comparisons. NFC.

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 9 13:07:02 PST 2018


dblaikie added inline comments.


================
Comment at: lib/Sema/SemaOverload.cpp:8979
+    // has fewer enable_if attributes than Cand2, and vice versa.
+    if (std::get<0>(Pair) == None)
       return Comparison::Worse;
----------------
I'd probably write this as "if (!std::get<0>(Pair))" - but I understand that opinions differ on such things easily enough.


================
Comment at: lib/Serialization/ASTReaderDecl.cpp:2922
+    // Return false if the number of enable_if attributes is different.
+    if (std::get<0>(Pair).hasValue() != std::get<1>(Pair).hasValue())
+      return false;
----------------
This might be more legible as "if (std::get<0>(Pair) || std::get<1>(Pair))", I think? (optionally using "hasValue", if preferred - but comparing the hasValues to each other, rather than testing if either is false, seems a bit opaque to me at least)


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55468/new/

https://reviews.llvm.org/D55468





More information about the cfe-commits mailing list