🐛 Fix swapped arguments in CLJS PathData -nth with default

The CLJS implementation of PathData's -nth protocol method had
swapped arguments in the 3-arity version (with default value).
The call (d/in-range? i size) should be (d/in-range? size i)
to match the CLJ implementation. With swapped args, valid indices
always returned the default value, and invalid indices attempted
out-of-bounds buffer reads.
This commit is contained in:
Andrey Antukh 2026-04-09 13:59:34 +00:00 committed by Belén Albeza
parent e511576f66
commit 2eaf117b56

View File

@ -474,7 +474,7 @@
nil))
(-nth [_ i default]
(if (d/in-range? i size)
(if (d/in-range? size i)
(read-segment buffer i)
default))