diff options
author | Erik Svedäng <erik.svedang@gmail.com> | 2021-10-19 09:19:41 +0200 |
---|---|---|
committer | Erik Svedäng <erik.svedang@gmail.com> | 2021-10-19 09:19:41 +0200 |
commit | 73cb9549143c3b1d78cf50840f6557e5ec0b43e5 (patch) | |
tree | 044015fc39c3052fedcea19ba567baab6438e567 | |
parent | ba31acea8b3fc8c644fde2626673f5804815528b (diff) |
fix: use `aset-uninitialized!`scan
-rw-r--r-- | core/Array.carp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/Array.carp b/core/Array.carp index 0cf77fda..98e9a233 100644 --- a/core/Array.carp +++ b/core/Array.carp @@ -51,9 +51,9 @@ For example, a scan using `Int.+` over the array [1 1 1 1 1] (starting at 0) wil (let [n (length xs) ys (allocate (inc n))] (do - (aset! &ys 0 @&x) + (aset-uninitialized! &ys 0 @&x) (for [i 1 (inc n)] - (aset! &ys i (~f (unsafe-nth &ys (dec i)) (unsafe-nth xs (dec i))))) + (aset-uninitialized! &ys i (~f (unsafe-nth &ys (dec i)) (unsafe-nth xs (dec i))))) ys))) (doc endo-scan "Like `Array.scan`, but uses the first element of the array as the starting value. |