Skip to content

Commit 244aec9

Browse files
jimpilstuarthalloway
authored andcommitted
amap calls alength once
Signed-off-by: Stuart Halloway <stu@cognitect.com>
1 parent 2b242f9 commit 244aec9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/clj/clojure/core.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -5157,10 +5157,10 @@
51575157
array ret."
51585158
{:added "1.0"}
51595159
[a idx ret expr]
5160-
`(let [a# ~a
5160+
`(let [a# ~a l# (alength a#)
51615161
~ret (aclone a#)]
51625162
(loop [~idx 0]
5163-
(if (< ~idx (alength a#))
5163+
(if (< ~idx l#)
51645164
(do
51655165
(aset ~ret ~idx ~expr)
51665166
(recur (unchecked-inc ~idx)))

0 commit comments

Comments
 (0)