mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 23:24:39 +00:00
parser_keywords: Pre-create "begin" and "else" wcstrings
Otherwise this creates two wcstrings every call. C++ is silly.
This commit is contained in:
parent
5012fb0e36
commit
366c21ca47
1 changed files with 3 additions and 1 deletions
|
@ -9,7 +9,9 @@
|
|||
#include "parser_keywords.h"
|
||||
|
||||
bool parser_keywords_skip_arguments(const wcstring &cmd) {
|
||||
return cmd == L"else" || cmd == L"begin";
|
||||
static const wcstring el = L"else";
|
||||
static const wcstring beg = L"begin";
|
||||
return cmd == el || cmd == beg;
|
||||
}
|
||||
|
||||
static const std::unordered_set<wcstring> subcommand_keywords = {L"command", L"builtin", L"while", L"exec",
|
||||
|
|
Loading…
Reference in a new issue