fix array handling code

This commit is contained in:
Kristin Rutenkolk 2024-10-28 21:28:50 +01:00
parent 43acc60784
commit 8844eef320

View file

@ -1650,20 +1650,19 @@
(let [outer-code `(let [arr# (~(coffitype->array-fn (second _type)) ~(second (rest _type)))] arr# )
gen-arr (nth outer-code 2)]
[(concat (butlast outer-code)
(list
(concat [`aset gen-arr]
(reduce
concat
(map
(fn [index]
(let [deserialize-instructions
(generate-deserialize
(second _type)
(+ offset (* (size-of (second _type)) index)))]
(if (vector? deserialize-instructions)
(list `aset gen-arr index (first deserialize-instructions))
#_(if true #_(vector? deserialize-instructions)
(list index (first deserialize-instructions))
(list index deserialize-instructions))))
(range (second (rest _type)))))))
(list index deserialize-instructions))
))
(range (second (rest _type))))
[gen-arr])]))
(defn typelist [typename fields]