diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-12-19 21:47:44 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2019-01-20 22:59:28 +1100 |
| commit | 566268d7bc97f98bf749e1283424b68dc9b5304c (patch) | |
| tree | 90e4ad1d1af4b74c0294bbaef8886f914f34825a /src/shell_manager.cc | |
| parent | 3babd0685c0290e7c0b885d4cd3c16ef216503e3 (diff) | |
Refactor RegexIterator to use a Sentinel
Diffstat (limited to 'src/shell_manager.cc')
| -rw-r--r-- | src/shell_manager.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/shell_manager.cc b/src/shell_manager.cc index 56fbfe38..4c0aded2 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -136,10 +136,9 @@ Vector<String> generate_env(StringView cmdline, const Context& context, const Sh static const Regex re(R"(\bkak_(\w+)\b)"); Vector<String> kak_env; - for (RegexIterator<const char*> it{cmdline.begin(), cmdline.end(), re}, end; - it != end; ++it) + for (auto&& match : RegexIterator{cmdline.begin(), cmdline.end(), re}) { - StringView name{(*it)[1].first, (*it)[1].second}; + StringView name{match[1].first, match[1].second}; auto match_name = [&](const String& s) { return s.substr(0_byte, name.length()) == name and |
