From fa9b9522959ad3d19098ddb5618004c5fa3ad1fb Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sun, 12 Jan 2025 17:45:10 -0800 Subject: [PATCH] nostrdb: add is_replaceable_kind helper we will be using this to detect replaceable kinds Signed-off-by: William Casarin --- nostrdb/src/nostrdb.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nostrdb/src/nostrdb.c b/nostrdb/src/nostrdb.c index 15a8339c..b499fe02 100644 --- a/nostrdb/src/nostrdb.c +++ b/nostrdb/src/nostrdb.c @@ -263,6 +263,15 @@ struct ndb_search_words int num_words; }; + +static inline int is_replaceable_kind(uint64_t kind) +{ + return kind == 0 || kind == 3 + || (10000 <= kind && kind < 20000) + || (30000 <= kind && kind < 40000); +} + + // ndb_text_search_key // // This is compressed when in lmdb: