mirror of
git://jb55.com/damus
synced 2024-10-04 19:00:42 +00:00
nostrdb/search: fix another newest-first bug
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
parent
f72b297d77
commit
6b8cf51720
@ -2411,11 +2411,16 @@ retry:
|
||||
}
|
||||
|
||||
if (!ndb_prefix_matches(result, search_word)) {
|
||||
/*
|
||||
printf("result prefix '%.*s' didn't match search word '%.*s'\n",
|
||||
result->key.str_len, result->key.str,
|
||||
search_word->word_len, search_word->word);
|
||||
*/
|
||||
// we should only do this if we're going in reverse
|
||||
if (retries == 0 && op == MDB_SET_RANGE && order_op == MDB_PREV) {
|
||||
// if set range worked and our key exists, it should be
|
||||
// the one right before this one
|
||||
if (mdb_cursor_get(cursor, k, &v, MDB_PREV))
|
||||
mdb_cursor_get(cursor, k, &v, MDB_PREV);
|
||||
goto retry;
|
||||
} else {
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user