[PATCH] D23119: Fix quadratic runtime when adding items to tooling::Replacements.
Manuel Klimek via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 3 07:44:18 PDT 2016
klimek added inline comments.
================
Comment at: cfe/trunk/lib/Tooling/Core/Replacement.cpp:169
@@ +168,3 @@
+ // starts after R is (I+1).
+ if (I != Replaces.end() && *I == R)
+ ++I;
----------------
ioeric wrote:
> I think we should ignore replacement text when checking equality between `*I` and `R` here.
lower_bound already compares the replacement text, so as the comment says, unless I'm mistaken, this can only happen if R == AtEnd, which means that R has an empty replacement text.
Can you come up with a test that would break?
Repository:
rL LLVM
https://reviews.llvm.org/D23119
More information about the cfe-commits
mailing list