aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Sierra <mail@stuartsierra.com>2009-08-19 11:50:45 -0400
committerStuart Sierra <mail@stuartsierra.com>2009-08-19 11:50:45 -0400
commit9374fa2ba6e05d7f523bef7698609d641cc916ac (patch)
tree2b29561876cad45ee1c4dba6f63b962e01ec2ff1
parent34fc5f2bc4dbae6b1b05b77cda98f56cc62e73b7 (diff)
str_utils2.clj: added type hints to avoid reflection
-rw-r--r--src/clojure/contrib/str_utils2.clj6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/clojure/contrib/str_utils2.clj b/src/clojure/contrib/str_utils2.clj
index 26dd849f..e5a541cf 100644
--- a/src/clojure/contrib/str_utils2.clj
+++ b/src/clojure/contrib/str_utils2.clj
@@ -254,7 +254,7 @@
[#^String s]
(let [buffer (StringBuilder. (.length s))
;; array to make a String from one code point
- array (make-array Integer/TYPE 1)]
+ #^"[I" array (make-array Integer/TYPE 1)]
(docodepoints [c s]
(aset-int array 0 c)
(if (Character/isLowerCase c)
@@ -270,8 +270,8 @@
[#^String s]
(if (< (count s) 2)
(.toUpperCase s)
- (str (.toUpperCase (subs s 0 1))
- (.toLowerCase (subs s 1)))))
+ (str (.toUpperCase #^String (subs s 0 1))
+ (.toLowerCase #^String (subs s 1)))))
(defn ltrim
"Removes whitespace from the left side of string."