mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-02 07:24:19 +08: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
|
@ -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 New Issue
Block a user