Skip to content

Commit

Permalink
Fix wrong type hints, closes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronsa committed Jan 8, 2014
1 parent f6cf6b3 commit f87a1ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/clojure/clojurewerkz/chash/ring.clj
Expand Up @@ -8,11 +8,11 @@
;; Implementation
;;

(def ^{:const true :tag long}
(def ^{:const true :tag 'long}
ring-top (dec (Math/pow 2 160)))

(defn ^long ring-increment
[^long n]
(defn ring-increment
^double [^long n]
(quot ring-top n))

(defrecord Ring [^long n-partitions ^clojure.lang.IPersistentList claims])
Expand Down Expand Up @@ -44,10 +44,10 @@
[^Ring chash idx]
(pl/get (.claims chash) idx))

(defn ^long key-of
(defn key-of
"Returns value's key into the ring. Two values with the same SHA-1 hash value are
considered the same name"
[value]
^long [value]
(.asLong (h/sha1-of value)))

(defn claims
Expand Down
2 changes: 1 addition & 1 deletion test/clojurewerkz/chash/ring_test.clj
Expand Up @@ -138,7 +138,7 @@
(let [n 8
seed "node1@giove.local"
r (ch/fresh n seed)]
(is (ch/partitions r) #{1.8268770466636286E47})
(is (= (second (ch/partitions r)) 1.8268770466636286E47))
(is (= 1.8268770466636286E47 (ch/next-index r (ch/key-of 1))))))


Expand Down

0 comments on commit f87a1ef

Please sign in to comment.