[PATCH] Templatize tooling::deduplicate()

Daniel Jasper djasper at google.com
Fri Aug 16 04:45:41 PDT 2013


  I don't fully understand from your last comment whether you want to move forward with this or not.


================
Comment at: lib/Tooling/Refactoring.cpp:91
@@ +90,3 @@
+bool operator<(const Replacement &LHS, const Replacement &RHS) {
+  if (LHS.getFilePath() != RHS.getFilePath())
+    return LHS.getFilePath() < RHS.getFilePath();
----------------
Edwin Vane wrote:
> Daniel Jasper wrote:
> > I'd keep the original order of comparisons. String comparisons are relatively expensive. Thus, I'd do that only if offset and length are both equal.
> Thisi **is** the original order, I just copied it. However, I agree with fixing up the comparison order.
Yeah, right. Sorry, I got confused as you also changed the order of Less/< and == (so I just look to the left here and there the evaluation order did make more sense).


http://llvm-reviews.chandlerc.com/D1415



More information about the cfe-commits mailing list