parser_keywords: Pre-create "begin" and "else" wcstrings

Otherwise this creates two wcstrings every call.

C++ is silly.
This commit is contained in:
Fabian Homborg 2018-12-01 22:09:29 +01:00
parent 5012fb0e36
commit 366c21ca47

View file

@ -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",