mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Replace an expensive expand_one call with the cheaper unescape_string
Makes parsing a little faster
This commit is contained in:
parent
46cd89c2db
commit
ebfaa8cc95
1 changed files with 2 additions and 2 deletions
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue