From 148f8629454d5d8f56cccf327420c098a37003ae Mon Sep 17 00:00:00 2001 From: Alan Gutierrez Date: Sat, 19 Sep 2020 20:51:52 -0500 Subject: [PATCH] Fix indexOf not-yet-inserted key. Closes #658. --- cursor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cursor.js b/cursor.js index 9fe9cfaa..09075700 100644 --- a/cursor.js +++ b/cursor.js @@ -67,7 +67,7 @@ class Cursor { } // We only insert before the key on the left most page. if (~index == 0) { - return this.page.id == '0.1' || comparator(this.page.key, key) < 0 + return this.page.id == '0.1' || comparator(this.page.key, key) <= 0 ? { index: ~index, found: false } : { index: null, found: false } }