mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-18 20:11:15 -03:00
Reset autoloads in response to variable changes
Prior to this fix, autoloads like function and completion autoloads
would check their path variable (like fish_function_path) on every
autoload request. Switch to invalidating it in response to the variable
changing.
This improves time on a microbenchmark:
for i in (seq 50000)
setenv test_env val$i
end
from ~11 seconds to ~6.5 seconds.
This commit is contained in:
@@ -339,6 +339,8 @@ int function_get_definition_lineno(const wcstring &name) {
|
||||
return 1 + std::count(source.begin(), source.begin() + func_start, L'\n');
|
||||
}
|
||||
|
||||
void function_invalidate_path() { function_autoloader.invalidate(); }
|
||||
|
||||
// Setup the environment for the function. There are three components of the environment:
|
||||
// 1. argv
|
||||
// 2. named arguments
|
||||
|
||||
Reference in New Issue
Block a user