mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 07:04:29 +00:00
Replace a HashMap w/ a BTreeMap
The HashMap is used to generate the __fish_describe_command integration completions. Given the nature of the allocations and the numbers that we use, a BTreeMap would theoretically perform better. Benchmarks show a 2-9% improvement in completion times consistently in favor of BTreeMap.
This commit is contained in:
parent
73908f1218
commit
50a6dfd10d
1 changed files with 1 additions and 1 deletions
|
@ -988,7 +988,7 @@ impl<'ctx> Completer<'ctx> {
|
|||
|
||||
// Then discard anything that is not a possible completion and put the result into a
|
||||
// hashtable with the completion as key and the description as value.
|
||||
let mut lookup = HashMap::new();
|
||||
let mut lookup = BTreeMap::new();
|
||||
// A typical entry is the command name, followed by a tab, followed by a description.
|
||||
for elstr in &mut list {
|
||||
// Skip keys that are too short.
|
||||
|
|
Loading…
Reference in a new issue