Skip to content

Commit

Permalink
CLJ-XXXX remove unnecessary key-check for HashCollisionNode
Browse files Browse the repository at this point in the history
  • Loading branch information
namenu authored and swannodette committed Feb 20, 2024
1 parent 3d110e4 commit d90f7b2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/cljs/cljs/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7828,15 +7828,13 @@ reduces them without incurring seq initialization"

(inode-lookup [inode shift hash key not-found]
(let [idx (hash-collision-node-find-index arr cnt key)]
(cond (< idx 0) not-found
(key-test key (aget arr idx)) (aget arr (inc idx))
:else not-found)))
(cond (< idx 0) not-found
:else (aget arr (inc idx)))))

(inode-find [inode shift hash key not-found]
(let [idx (hash-collision-node-find-index arr cnt key)]
(cond (< idx 0) not-found
(key-test key (aget arr idx)) (MapEntry. (aget arr idx) (aget arr (inc idx)) nil)
:else not-found)))
(cond (< idx 0) not-found
:else (MapEntry. (aget arr idx) (aget arr (inc idx)) nil))))

(inode-seq [inode]
(create-inode-seq arr))
Expand Down

0 comments on commit d90f7b2

Please sign in to comment.