Fix reflection & boxed-math warning, fixes #207

This commit is contained in:
Tommi Reiman 2019-01-18 08:51:43 +02:00
parent d203832667
commit 1e7b118ce4
4 changed files with 6 additions and 6 deletions

View file

@ -149,7 +149,7 @@
#?(:clj (def +percents+ (into [] (map #(format "%%%02X" %) (range 0 256)))))
#?(:clj (defn byte->percent [byte]
#?(:clj (defn byte->percent [^long byte]
(nth +percents+ (if (< byte 0) (+ 256 byte) byte))))
#?(:clj (defn percent-encode [^String s]

View file

@ -83,8 +83,8 @@
(if-not compile
this
(let [compiled (::compiled opts 0)
opts (assoc opts ::compiled (inc compiled))]
(when (>= compiled *max-compile-depth*)
opts (assoc opts ::compiled (inc ^long compiled))]
(when (>= ^long compiled ^long *max-compile-depth*)
(throw
(ex-info
(str "Too deep Interceptor compilation - " compiled)

View file

@ -59,8 +59,8 @@
(if-not compile
this
(let [compiled (::compiled opts 0)
opts (assoc opts ::compiled (inc compiled))]
(when (>= compiled *max-compile-depth*)
opts (assoc opts ::compiled (inc ^long compiled))]
(when (>= ^long compiled ^long *max-compile-depth*)
(throw
(ex-info
(str "Too deep Middleware compilation - " compiled)

View file

@ -57,7 +57,7 @@
(defn compile [trie]
"Compiles the Trie so that [[lookup]] can be used."
#?(:cljs trie
:clj (.matcher ^SegmentTrie (or trie (SegmentTrie.)))))
:clj (.matcher (or ^SegmentTrie trie (SegmentTrie.)))))
(defn scanner [compiled-tries]
"Returns a new compiled trie that does linear scan on the given compiled tries on [[lookup]]."