commit 3e5d7581ba73946ef9f944398a01f4a246ec2068
parent 06445de1975a1f19acc03dbde83df95ea7bd75ac
Author: William Casarin <jb55@jb55.com>
Date: Sat, 2 Dec 2023 11:49:08 -0800
nostrdb/refactor: move search key printer in case we need it
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/nostrdb/nostrdb.c b/nostrdb/nostrdb.c
@@ -2465,6 +2465,14 @@ static int prefix_count(const char *str1, int len1, const char *str2, int len2)
return count;
}
+static void ndb_print_text_search_key(struct ndb_text_search_key *key)
+{
+ printf("K<'%.*s' %d %" PRIu64 " note_id:%" PRIu64 ">", key->str_len, key->str,
+ key->word_index,
+ key->timestamp,
+ key->note_id);
+}
+
// This is called when scanning the full text search index. Scanning stops
// when we no longer have a prefix match for the word
@@ -2579,14 +2587,6 @@ static void ndb_text_search_results_init(
results->num_results = 0;
}
-static void ndb_print_text_search_key(struct ndb_text_search_key *key)
-{
- printf("K<'%.*s' %d %" PRIu64 " note_id:%" PRIu64 ">", key->str_len, key->str,
- key->word_index,
- key->timestamp,
- key->note_id);
-}
-
void ndb_default_text_search_config(struct ndb_text_search_config *cfg)
{
cfg->order = NDB_ORDER_DESCENDING;