Skip to content

Commit e442c55

Browse files
committed
Safe dropping of empty destination arrays
1 parent f4b1f24 commit e442c55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Data/Array/Destination.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ dropEmpty = Unsafe.toLinear unsafeDrop where
186186
unsafeDrop :: DArray a -> ()
187187
unsafeDrop (DArray ds)
188188
| MVector.length ds > 0 = error "Destination.dropEmpty on non-empty array."
189-
| otherwise = ()
189+
| otherwise = ds `seq` ()
190190

191191
-- | @'split' n dest = (destl, destr)@ such as @destl@ has length @n@.
192192
--

0 commit comments

Comments
 (0)