mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-22 18:18:40 +08:00
Remove unnecessary string copy
This called function_exists_no_autoload with a c_str(). Only that takes a wcstring, so the constructor gets called which copies that.
This commit is contained in:
parent
eb8a93f499
commit
ddfad001eb
@ -898,7 +898,7 @@ bool completer_t::complete_param(const wcstring &cmd_orig, const wcstring &popt,
|
||||
bool head_exists = builtin_exists(cmd);
|
||||
// Only reload environment variables if builtin_exists returned false, as an optimization
|
||||
if (head_exists == false) {
|
||||
head_exists = function_exists_no_autoload(cmd.c_str(), vars);
|
||||
head_exists = function_exists_no_autoload(cmd, vars);
|
||||
// While it may seem like first testing `path_get_path` before resorting to an env lookup
|
||||
// may be faster, path_get_path can potentially do a lot of FS/IO access, so env.get() +
|
||||
// function_exists() should still be faster.
|
||||
|
Loading…
x
Reference in New Issue
Block a user