Replace an expensive expand_one call with the cheaper unescape_string

Makes parsing a little faster
This commit is contained in:
ridiculousfish 2014-12-23 10:08:41 -08:00
parent 46cd89c2db
commit ebfaa8cc95

View file

@ -1240,8 +1240,8 @@ static parse_keyword_t keyword_for_token(token_type tok, const wchar_t *tok_txt)
} }
else else
{ {
wcstring storage = tok_txt; wcstring storage;
if (expand_one(storage, EXPAND_SKIP_CMDSUBST | EXPAND_SKIP_VARIABLES | EXPAND_SKIP_WILDCARDS | EXPAND_SKIP_JOBS | EXPAND_SKIP_HOME_DIRECTORIES)) if (unescape_string(tok_txt, &storage, 0))
{ {
result = keyword_with_name(storage.c_str()); result = keyword_with_name(storage.c_str());
} }