Skip to content

Commit

Permalink
coerce to avoid reflection on Character/isDigit
Browse files Browse the repository at this point in the history
  • Loading branch information
fogus committed Jan 17, 2025
1 parent f8f44e0 commit ae8557b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/clojure/clojure/tools/analyzer/jvm.clj
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
(maybe-class-literal sym-ns))] ;; Class/field
(let [opname (name form)]
(if (and (= (count opname) 1)
(Character/isDigit (first opname)))
(Character/isDigit (char (first opname))))
form ;; Array/<n>
(with-meta (list '. target (symbol (str "-" opname))) ;; transform to (. Class -field)
(meta form))))
Expand Down
2 changes: 1 addition & 1 deletion src/main/clojure/clojure/tools/analyzer/jvm/utils.clj
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
(defn maybe-array-class-sym [x]
(let [sname (name x)]
(if-let [c (and (= (count sname) 1)
(Character/isDigit (first sname))
(Character/isDigit (char (first sname)))
(namespace x))]
(when-let [c (or (specials c)
(maybe-class-from-string c))]
Expand Down

0 comments on commit ae8557b

Please sign in to comment.