Skip to content

Commit

Permalink
CLJ-XXXX remove unnecessary key-check for HashCollisionNode (#222)
Browse files Browse the repository at this point in the history
Co-authored-by: Hyunwoo Nam <[email protected]>

port of fix to Clojure clojure/clojure@8b4261b
  • Loading branch information
swannodette authored Feb 20, 2024
1 parent 3d110e4 commit 2c5dbdf
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 2c5dbdf

Please sign in to comment.