[string_util] base::ReplaceChars and base::RemoveChars can be O(n^2) |
||
Issue description
base::ReplaceChars and base::RemoveChars can be O(n^2) in the worst case.
A loop like the below shows the problem:
std::string value = "*";
for (int i = 0; i < 20; i++) {
base::ReplaceChars(value, "*", "**", &value);
}
,
Sep 26 2017
Fixed by https://chromium-review.googlesource.com/c/chromium/src/+/642357 |
||
►
Sign in to add a comment |
||
Comment 1 by bugdroid1@chromium.org
, Sep 26 2017