summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Halloway <stu@thinkrelevance.com>2010-04-24 14:04:45 -0400
committerStuart Halloway <stu@thinkrelevance.com>2010-04-27 15:35:23 -0400
commitf6c74643606461e119998421e39c1972e255d128 (patch)
tree0cc27cdde621d2cd7e853c3e078875d3fb4f0805
parenta3d1d494e9e574599c50dd83749183c66f653192 (diff)
eliminate reflection in #266
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
-rw-r--r--src/clj/clojure/gvec.clj9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/clj/clojure/gvec.clj b/src/clj/clojure/gvec.clj
index ce4fb7d7..7da8e49e 100644
--- a/src/clj/clojure/gvec.clj
+++ b/src/clj/clojure/gvec.clj
@@ -339,15 +339,16 @@
(compareTo [this o]
(if (identical? this o)
0
- (let [ocnt (.count (cast clojure.lang.IPersistentVector o))]
+ (let [#^clojure.lang.IPersistentVector v (cast clojure.lang.IPersistentVector o)
+ vcnt (.count v)]
(cond
- (< cnt ocnt) -1
- (> cnt ocnt) 1
+ (< cnt vcnt) -1
+ (> cnt vcnt) 1
:else
(loop [i (int 0)]
(if (= i cnt)
0
- (let [comp (clojure.lang.Util/compare (.nth this i) (.nth o i))]
+ (let [comp (clojure.lang.Util/compare (.nth this i) (.nth v i))]
(if (= 0 comp)
(recur (inc i))
comp))))))))