From 49c52b025f2cb5bd66f729f873d2e690b613fb39 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 25 Mar 2018 16:47:19 +1100 Subject: Remove contains_that and use any_of to be closer to the c++ stdlib --- src/shell_manager.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/shell_manager.cc') diff --git a/src/shell_manager.cc b/src/shell_manager.cc index c0ae5b10..11d2b0cc 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -126,10 +126,10 @@ Vector generate_env(StringView cmdline, const Context& context, const Sh StringView name{(*it)[1].first, (*it)[1].second}; auto match_name = [&](const String& s) { - return s.length() > name.length() and - prefix_match(s, name) and s[name.length()] == '='; + return s.substr(0_byte, name.length()) == name and + s.substr(name.length(), 1_byte) == "="; }; - if (contains_that(kak_env, match_name)) + if (any_of(kak_env, match_name)) continue; auto var_it = shell_context.env_vars.find(name); -- cgit v1.2.3