Permalink
Browse files

Add a few type hints to avoid reflection.

  • Loading branch information...
1 parent f132606 commit a4fd13064bcd1045b101ce5c8266e2f7a7fdc801 @ghoseb ghoseb committed Dec 30, 2011
Showing with 3 additions and 3 deletions.
  1. +1 −1 ring-core/src/ring/middleware/session/cookie.clj
  2. +2 −2 ring-servlet/src/ring/util/servlet.clj
View
2 ring-core/src/ring/middleware/session/cookie.clj
@@ -77,7 +77,7 @@
(let [data (encrypt key (.getBytes (pr-str data)))]
(str (codec/base64-encode data) "--" (hmac key data))))
-(defn- secure-compare [a b]
+(defn- secure-compare [^String a ^String b]
(if (and a b (= (.length a) (.length b)))
(= 0
(reduce bit-or
View
4 ring-servlet/src/ring/util/servlet.clj
@@ -60,7 +60,7 @@
[^HttpServletResponse response, status]
(.setStatus response status))
-(defn set-content-type [response content-type]
+(defn set-content-type [^HttpServletResponse response content-type]
(.setContentType
response
(-> content-type
@@ -73,7 +73,7 @@
(re-find #"charset=(.+);?")
(second)))
-(defn- set-character-encoding [response content-type]
+(defn- set-character-encoding [^HttpServletResponse response content-type]
(when-let [charset (get-charset content-type)]
(.setCharacterEncoding response charset)))

0 comments on commit a4fd130

Please sign in to comment.