Use range based find_if wrapper for finding shell env vars

This commit is contained in:
Maxime Coste 2017-06-07 19:46:16 +01:00
parent d9b1ee13d9
commit 4495aefea6

View File

@ -301,9 +301,7 @@ void ShellManager::register_env_var(StringView str, bool prefix,
String ShellManager::get_val(StringView name, const Context& context) const
{
auto env_var = std::find_if(
m_env_vars.begin(), m_env_vars.end(),
[name](const EnvVarDesc& desc) {
auto env_var = find_if(m_env_vars, [name](const EnvVarDesc& desc) {
return desc.prefix ? prefix_match(name, desc.str) : name == desc.str;
});