mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-31 23:28:45 +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));
|
results.insert(std::begin(reserved_keywords), std::end(reserved_keywords));
|
||||||
return results;
|
return results;
|
||||||
})();
|
})();
|
||||||
const static auto max_len = list_max_length(search_list);
|
const static size_t max_len = list_max_length(search_list);
|
||||||
const static auto not_found = search_list.end();
|
return word.length() <= max_len && search_list.count(word) > 0;
|
||||||
|
|
||||||
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue