summaryrefslogtreecommitdiff
path: root/src/string_vec.h
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/string_vec.h
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/string_vec.h')
-rw-r--r--src/string_vec.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/string_vec.h b/src/string_vec.h
index f3e840c..f8ca3e0 100644
--- a/src/string_vec.h
+++ b/src/string_vec.h
@@ -5,6 +5,7 @@
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
+#include "history.h"
struct scored_string {
char *string;
@@ -30,6 +31,8 @@ void string_vec_add(struct string_vec *restrict vec, const char *restrict str);
void string_vec_sort(struct string_vec *restrict vec);
+void string_vec_history_sort(struct string_vec *restrict vec, struct history *history);
+
void string_vec_uniq(struct string_vec *restrict vec);
struct scored_string *string_vec_find(struct string_vec *restrict vec, const char *str);