mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
Simplify parser_keywords_is_reserved
This commit is contained in:
parent
93cb0e2abb
commit
68275e7f58
1 changed files with 2 additions and 5 deletions
|
@ -76,9 +76,6 @@ bool parser_keywords_is_reserved(const wcstring &word) {
|
|||
results.insert(std::begin(reserved_keywords), std::end(reserved_keywords));
|
||||
return results;
|
||||
})();
|
||||
const static auto max_len = list_max_length(search_list);
|
||||
const static auto not_found = search_list.end();
|
||||
|
||||
// Everything above is executed only at startup, this is the actual optimized search routine:
|
||||
return word.length() <= max_len && search_list.find(word) != not_found;
|
||||
const static size_t max_len = list_max_length(search_list);
|
||||
return word.length() <= max_len && search_list.count(word) > 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue