mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 10:31:14 -03:00
Remove vars parameter from function_exists_no_autoload
This variable was unused.
This commit is contained in:
@@ -903,7 +903,7 @@ bool completer_t::complete_param(const wcstring &cmd_orig, const wcstring &popt,
|
|||||||
bool head_exists = builtin_exists(cmd);
|
bool head_exists = builtin_exists(cmd);
|
||||||
// Only reload environment variables if builtin_exists returned false, as an optimization
|
// Only reload environment variables if builtin_exists returned false, as an optimization
|
||||||
if (head_exists == false) {
|
if (head_exists == false) {
|
||||||
head_exists = function_exists_no_autoload(cmd, vars);
|
head_exists = function_exists_no_autoload(cmd);
|
||||||
// While it may seem like first testing `path_get_path` before resorting to an env lookup
|
// 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() +
|
// may be faster, path_get_path can potentially do a lot of FS/IO access, so env.get() +
|
||||||
// function_exists() should still be faster.
|
// function_exists() should still be faster.
|
||||||
|
|||||||
@@ -226,8 +226,7 @@ void function_load(const wcstring &cmd, parser_t &parser) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int function_exists_no_autoload(const wcstring &cmd, const environment_t &vars) {
|
int function_exists_no_autoload(const wcstring &cmd) {
|
||||||
(void)vars;
|
|
||||||
if (parser_keywords_is_reserved(cmd)) return 0;
|
if (parser_keywords_is_reserved(cmd)) return 0;
|
||||||
auto funcset = function_set.acquire();
|
auto funcset = function_set.acquire();
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ int function_exists(const wcstring &name, parser_t &parser);
|
|||||||
void function_load(const wcstring &name, parser_t &parser);
|
void function_load(const wcstring &name, parser_t &parser);
|
||||||
|
|
||||||
/// Returns true if the function with the name name exists, without triggering autoload.
|
/// Returns true if the function with the name name exists, without triggering autoload.
|
||||||
int function_exists_no_autoload(const wcstring &name, const environment_t &vars);
|
int function_exists_no_autoload(const wcstring &name);
|
||||||
|
|
||||||
/// Returns all function names.
|
/// Returns all function names.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -461,8 +461,7 @@ bool autosuggest_validate_from_history(const history_item_t &item,
|
|||||||
bool cmd_ok = false;
|
bool cmd_ok = false;
|
||||||
if (path_get_path(parsed_command, NULL, vars)) {
|
if (path_get_path(parsed_command, NULL, vars)) {
|
||||||
cmd_ok = true;
|
cmd_ok = true;
|
||||||
} else if (builtin_exists(parsed_command) ||
|
} else if (builtin_exists(parsed_command) || function_exists_no_autoload(parsed_command)) {
|
||||||
function_exists_no_autoload(parsed_command, vars)) {
|
|
||||||
cmd_ok = true;
|
cmd_ok = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1122,7 +1121,7 @@ static bool command_is_valid(const wcstring &cmd, enum parse_statement_decoratio
|
|||||||
if (!is_valid && builtin_ok) is_valid = builtin_exists(cmd);
|
if (!is_valid && builtin_ok) is_valid = builtin_exists(cmd);
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
if (!is_valid && function_ok) is_valid = function_exists_no_autoload(cmd, vars);
|
if (!is_valid && function_ok) is_valid = function_exists_no_autoload(cmd);
|
||||||
|
|
||||||
// Abbreviations
|
// Abbreviations
|
||||||
if (!is_valid && abbreviation_ok) is_valid = expand_abbreviation(cmd, vars).has_value();
|
if (!is_valid && abbreviation_ok) is_valid = expand_abbreviation(cmd, vars).has_value();
|
||||||
|
|||||||
Reference in New Issue
Block a user