diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-06-24 12:24:24 +0100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-06-24 12:24:24 +0100 |
| commit | c6eddefb0d2154855cb55e5264e6b974b6e90dbe (patch) | |
| tree | 06fd98338be0d3ac42b9628935c44a31da8fb900 /src/string.cc | |
| parent | dc1b039282d3602d9074e18eac02527a882a4a9a (diff) | |
Slight code refactoring and perf improvement in vector option to string
Diffstat (limited to 'src/string.cc')
| -rw-r--r-- | src/string.cc | 3 |
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}; |
