mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-27 12: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:
@@ -1558,6 +1558,8 @@ wcstring complete_print() {
|
||||
return out;
|
||||
}
|
||||
|
||||
void complete_invalidate_path() { completion_autoloader.invalidate(); }
|
||||
|
||||
/// Completion "wrapper" support. The map goes from wrapping-command to wrapped-command-list.
|
||||
static fish_mutex_t wrapper_lock;
|
||||
typedef std::unordered_map<wcstring, wcstring_list_t> wrapper_map_t;
|
||||
|
||||
Reference in New Issue
Block a user