Miscellaneous optimizations to reduce string copying

This commit is contained in:
ridiculousfish
2014-01-07 14:57:58 -08:00
parent cb6be2a50d
commit b34721b3f4
7 changed files with 50 additions and 35 deletions

View File

@@ -1939,7 +1939,7 @@ int parser_t::parse_job(process_t *p, job_t *j, tokenizer_t *tok)
}
}
}
args.push_back(completion_t(nxt));
append_completion(args, nxt);
}
if (error_code == 0)
@@ -1982,8 +1982,8 @@ int parser_t::parse_job(process_t *p, job_t *j, tokenizer_t *tok)
if (use_implicit_cd)
{
args.clear();
args.push_back(completion_t(L"cd"));
args.push_back(completion_t(implicit_cd_path));
append_completion(args, L"cd");
append_completion(args, implicit_cd_path);
/* If we have defined a wrapper around cd, use it, otherwise use the cd builtin */
if (use_function && function_exists(L"cd"))