summaryrefslogtreecommitdiff
path: root/src/string.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/string.cc')
-rw-r--r--src/string.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/string.cc b/src/string.cc
index 6fb64098..36beca1e 100644
--- a/src/string.cc
+++ b/src/string.cc
@@ -222,9 +222,10 @@ String escape(StringView str, StringView characters, char escape)
{
String res;
res.reserve(str.length());
+ auto cbeg = characters.begin(), cend = characters.end();
for (auto it = str.begin(), end = str.end(); it != end; )
{
- auto next = std::find_if(it, end, [&characters](char c) { return contains(characters, c); });
+ auto next = std::find_first_of(it, end, cbeg, cend);
if (next != end)
{
res += StringView{it, next+1};