Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CLJS-824: Unsigned hash for keywords produced via keyword fn

Causes keyword hashes to be 32-bit signed values.
  • Loading branch information...
commit 5ca535759f8e2490b42dfa25df0458a6c3376d8c 1 parent ff7c945
@mfikes mfikes authored swannodette committed
Showing with 3 additions and 1 deletion.
  1. +1 −1  src/cljs/cljs/core.cljs
  2. +2 −0  test/cljs/cljs/core_test.cljs
View
2  src/cljs/cljs/core.cljs
@@ -2269,7 +2269,7 @@ reduces them without incurring seq initialization"
(satisfies? IList x))
(defn hash-keyword [k]
- (+ (hash-symbol k) 0x9e3779b9))
+ (int (+ (hash-symbol k) 0x9e3779b9)))
(deftype Keyword [ns name fqn ^:mutable _hash]
Object
View
2  test/cljs/cljs/core_test.cljs
@@ -1543,6 +1543,8 @@
(hash (hash-map :b 2 :a 1))))
(assert (= (hash {:start 133 :end 134})
(hash (apply hash-map [:start 133 :end 134]))))
+ (assert (= (hash :a)
+ (hash (keyword "a"))))
(defprotocol IHasFirst
(-get-first [this]))
Please sign in to comment.
Something went wrong with that request. Please try again.