Skip to content

Commit b1ea007

Browse files
committed
Add type hints for reflections
1 parent ce0290f commit b1ea007

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

core/src/yamlscript/parser.clj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
(:import
1212
(java.util Optional)
1313
(java.nio ByteBuffer)
14-
(java.nio IntBuffer)
1514
(java.nio.charset StandardCharsets)
1615
(org.rapidyaml Evt Rapidyaml)
1716
(org.snakeyaml.engine.v2.api LoadSettings)
@@ -238,23 +237,24 @@
238237

239238
(defn parse-rapidyaml-buf [^String yaml-string]
240239
(rest
241-
(let [parser ^Rapidyaml (new Rapidyaml)
240+
(let [parser (new Rapidyaml)
242241
_ (when TIMER
243242
(.timingEnabled parser true))
244-
srcbytes ^"[B" (.getBytes yaml-string StandardCharsets/UTF_8)
245-
srcbuffer ^ByteBuffer (ByteBuffer/allocateDirect (alength srcbytes))
243+
srcbytes (.getBytes yaml-string StandardCharsets/UTF_8)
244+
srcbuffer (ByteBuffer/allocateDirect (alength srcbytes))
246245
_ (.put srcbuffer srcbytes)
247-
masks ^IntBuffer (Rapidyaml/mkIntBuffer 5)
246+
masks (Rapidyaml/mkIntBuffer 5)
248247
needed (.parseYsToEvtBuf parser srcbuffer masks)
249248
_ (.position srcbuffer 0)
250249
_ (.put srcbuffer srcbytes)
251-
masks ^IntBuffer (Rapidyaml/mkIntBuffer needed)
250+
masks (Rapidyaml/mkIntBuffer needed)
252251
_ (.parseYsToEvtBuf parser srcbuffer masks)
253252
get-str (fn [i]
254-
(let [off (.get masks (inc i))
255-
len (.get masks (+ i 2))]
253+
(let [off (.get masks ^Long (inc i))
254+
len (.get masks ^Long (+ i 2))]
256255
(reduce
257-
(fn [slice i] (str slice (char (.get srcbuffer i))))
256+
(fn [slice i] (str slice
257+
(char (.get srcbuffer ^Long i))))
258258
"" (range off (+ off len)))))]
259259

260260
(loop [i 0, tag nil, anchor nil, events []]

0 commit comments

Comments
 (0)