File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 6083
6083
post-switch equivalence checking must not be done (occurs with hash
6084
6084
collisions)."
6085
6085
[expr-sym default tests thens]
6086
- (let [hashes (into1 #{} (map hash tests))]
6086
+ (let [hashcode #(clojure.lang.Util/hash %)
6087
+ hashes (into1 #{} (map hashcode tests))]
6087
6088
(if (== (count tests) (count hashes))
6088
6089
(if (fits-table? hashes)
6089
6090
; compact case ints, no shift-mask
6090
- [0 0 (case-map hash identity tests thens) :compact ]
6091
+ [0 0 (case-map hashcode identity tests thens) :compact ]
6091
6092
(let [[shift mask] (or (maybe-min-hash hashes) [0 0 ])]
6092
6093
(if (zero? mask)
6093
6094
; sparse case ints, no shift-mask
6094
- [0 0 (case-map hash identity tests thens) :sparse ]
6095
+ [0 0 (case-map hashcode identity tests thens) :sparse ]
6095
6096
; compact case ints, with shift-mask
6096
- [shift mask (case-map #(shift-mask shift mask (hash %)) identity tests thens) :compact ])))
6097
+ [shift mask (case-map #(shift-mask shift mask (hashcode %)) identity tests thens) :compact ])))
6097
6098
; resolve hash collisions and try again
6098
6099
(let [[tests thens skip-check] (merge-hash-collisions expr-sym default tests thens)
6099
6100
[shift mask case-map switch-type] (prep-hashes expr-sym default tests thens)
You can’t perform that action at this time.
0 commit comments