aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/persistent-hash-map.mjs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/persistent-hash-map.mjs b/src/persistent-hash-map.mjs
index f454c7d..911da05 100644
--- a/src/persistent-hash-map.mjs
+++ b/src/persistent-hash-map.mjs
@@ -581,10 +581,13 @@ function findArray(root, shift, hash, key) {
if (node === undefined) {
return undefined;
}
- if (node.type === ENTRY) {
+ if (node.type !== ENTRY) {
+ return find(node, shift + SHIFT, hash, key);
+ }
+ if (isEqual(key, node.k)) {
return node;
}
- return find(node, shift + SHIFT, hash, key);
+ return undefined;
}
/**
* @template K,V