on master help sign in
Switch argument ordering for copy
2e895e1Bryan O'Sullivan
Data/Text/Array.hs+1−1
@@ -189,7 +189,7 @@ run2 k = runST (do
189copy :: MArray s -- ^ source array
189copy :: MArray s -- ^ source array
190 -> MArray s -- ^ destination array
190 -> MArray s -- ^ destination array
191 -> ST s ()
191 -> ST s ()
192−copy src@(MArray slen _) dest@(MArray dlen _)
192+copy dest@(MArray dlen _) src@(MArray slen _)
193 | dlen >= slen = fast_loop 0
193 | dlen >= slen = fast_loop 0
194 | otherwise = fail "Data.Text.Array.copy: array too small"
194 | otherwise = fail "Data.Text.Array.copy: array too small"
195 where
195 where
Data/Text/Fusion.hs+1−1
@@ -105,7 +105,7 @@ unstream (Stream next0 s0 len) = I.textP (P.fst a) 0 (P.snd a)
105 | j >= top -> {-# SCC "unstream/resize" #-} do
105 | j >= top -> {-# SCC "unstream/resize" #-} do
106 let top' = (top + 1) `shiftL` 1
106 let top' = (top + 1) `shiftL` 1
107 arr' <- A.unsafeNew top'
107 arr' <- A.unsafeNew top'
108− A.copy arr arr' >> outer arr' top' s i
108+ A.copy arr' arr >> outer arr' top' s i
109 | otherwise -> unsafeWrite arr i x >>= loop s'
109 | otherwise -> unsafeWrite arr i x >>= loop s'
110 where j | ord x < 0x10000 = i
110 where j | ord x < 0x10000 = i
111 | otherwise = i + 1
111 | otherwise = i + 1
Data/Text/Lazy/Fusion.hs+1−1
@@ -67,7 +67,7 @@ unstreamChunks chunkSize (Stream next s0 len0)
67 | i + 1 >= len = do
67 | i + 1 >= len = do
68 let newLen = min (len `shiftL` 1) chunkSize
68 let newLen = min (len `shiftL` 1) chunkSize
69 marr' <- A.unsafeNew newLen
69 marr' <- A.unsafeNew newLen
70− A.copy marr marr'
70+ A.copy marr' marr
71 inner marr' newLen s i
71 inner marr' newLen s i
72 | otherwise =
72 | otherwise =
73 case next s of
73 case next s of