mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 11:21:15 -03:00
Convert var_table_t to an unordered_map
Profiling revealed string comparison in variable lookups to be a significant hotspot. This change causes `make test` to complete ~4.5% faster per `hyperfine`.
This commit is contained in:
@@ -635,7 +635,7 @@ std::shared_ptr<const null_terminated_array_t<char>> env_scoped_impl_t::create_e
|
||||
assert(var && "Variable should be present in uvars");
|
||||
// Note that std::map::insert does NOT overwrite a value already in the map,
|
||||
// which we depend on here.
|
||||
vals.insert(std::make_pair(key, *var));
|
||||
vals.insert(std::move(std::make_pair(std::move(key), std::move(*var))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user