nostrdb

an unfairly fast embedded nostr database backed by lmdb
git clone git://jb55.com/nostrdb
Log | Files | Refs | Submodules | README | LICENSE

commit 27d14cce563185628707d2aa547fcaad7de7d2b2
parent 6526776c6891df5ad548f42cb34c700bc8516524
Author: William Casarin <jb55@jb55.com>
Date:   Sat,  2 Dec 2023 11:49:08 -0800

refactor: move search key printer in case we need it

Diffstat:
Mnostrdb.c | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/nostrdb.c b/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;