aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikolaj Konarski <mikolaj.konarski@funktory.com>2025-12-09 14:02:16 +0100
committerMikolaj Konarski <mikolaj.konarski@funktory.com>2026-01-31 10:52:09 +0100
commitbf00298304d866da1ace4878a46e77e81613284a (patch)
treefd7c4cafebb7838d7409815f92d357b868d160c1
parentc20f930f21c60f91d01009fc7e16fa4ccc345828 (diff)
Speed up the bad case of mvecsReplicate using mvecsWriteLinear
-rw-r--r--src/Data/Array/Nested/Mixed.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Data/Array/Nested/Mixed.hs b/src/Data/Array/Nested/Mixed.hs
index e08f7aa..54b2a9f 100644
--- a/src/Data/Array/Nested/Mixed.hs
+++ b/src/Data/Array/Nested/Mixed.hs
@@ -714,7 +714,7 @@ instance (KnownShX sh', KnownElt a) => KnownElt (Mixed sh' a) where
mvecsReplicate sh example = do
vecs <- mvecsUnsafeNew sh example
- forM_ (shxEnum sh) $ \idx -> mvecsWrite sh idx example vecs
+ forM_ [0 .. shxSize sh - 1] $ \idx -> mvecsWriteLinear idx example vecs
-- this is a slow case, but the alternative, mvecsUnsafeNew with manual
-- writing in a loop, leads to every case being as slow
return vecs