summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2022-11-19 19:28:52 +0000
committerPhil Jones <philj56@gmail.com>2022-11-19 19:28:52 +0000
commit5da0579864a13b11bf0808f7f69f7b22f18054b1 (patch)
tree5e5975cddf5fe2c51d0f4df6b3d55ba7cb6136d3 /src/main.c
parent52be46abfca9a9b458d7455e891c937437b1356e (diff)
Fix sorting in normal tofi mode with history.
By using a hash table rather than binary search to find existing items, we can avoid the need to sort the input.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 448c164..9d9f4d9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1351,9 +1351,8 @@ int main(int argc, char *argv[])
if (tofi.history_file[0] == 0) {
tofi.use_history = false;
} else {
- string_vec_sort(&tofi.window.entry.commands);
tofi.window.entry.history = history_load(tofi.history_file);
- compgen_history_sort(&tofi.window.entry.commands, &tofi.window.entry.history);
+ string_vec_history_sort(&tofi.window.entry.commands, &tofi.window.entry.history);
}
}
}