mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 08:46:10 +08: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
@ -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…
x
Reference in New Issue
Block a user