on master help sign in
Switch argument ordering for copy

--HG-- extra : convert_revision : 1a780d4d0df78d797508d6d7668ef1ea6a9a1dd5

commit2e895e1a4cb31578b78a4de1e915df49f9237f46 authorBryan O'Sullivan <bos@serpentine.com> dateSun 15 Aug 2010, 21:04 (16 years ago) parente67c23f
3 files changed+3−3
Data/Text/Array.hs+1−1 Data/Text/Fusion.hs+1−1 Data/Text/Lazy/Fusion.hs+1−1
Data/Text/Array.hs+1−1
@@ -189,7 +189,7 @@ run2 k = runST (do
189189copy :: MArray s -- ^ source array
190190 -> MArray s -- ^ destination array
191191 -> ST s ()
192−copy src@(MArray slen _) dest@(MArray dlen _)
192+copy dest@(MArray dlen _) src@(MArray slen _)
193193 | dlen >= slen = fast_loop 0
194194 | otherwise = fail "Data.Text.Array.copy: array too small"
195195 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)
105105 | j >= top -> {-# SCC "unstream/resize" #-} do
106106 let top' = (top + 1) `shiftL` 1
107107 arr' <- A.unsafeNew top'
108− A.copy arr arr' >> outer arr' top' s i
108+ A.copy arr' arr >> outer arr' top' s i
109109 | otherwise -> unsafeWrite arr i x >>= loop s'
110110 where j | ord x < 0x10000 = i
111111 | otherwise = i + 1
Data/Text/Lazy/Fusion.hs+1−1
@@ -67,7 +67,7 @@ unstreamChunks chunkSize (Stream next s0 len0)
6767 | i + 1 >= len = do
6868 let newLen = min (len `shiftL` 1) chunkSize
6969 marr' <- A.unsafeNew newLen
70− A.copy marr marr'
70+ A.copy marr' marr
7171 inner marr' newLen s i
7272 | otherwise =
7373 case next s of