diff options
author | Ian Lynagh <igloo@earth.li> | 2012-07-15 00:39:47 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2012-07-15 00:39:47 +0100 |
commit | 2b44d34b87359f33d80035daad3449f5ac3280c4 (patch) | |
tree | 3bea9f08936f964b2d03d445d574b6ac24fac6b6 /compiler/utils/FastString.lhs | |
parent | c64a39a068f7b9d9b18417b31c7580f734c91b0e (diff) | |
download | haskell-2b44d34b87359f33d80035daad3449f5ac3280c4.tar.gz |
Small refactoring
Diffstat (limited to 'compiler/utils/FastString.lhs')
-rw-r--r-- | compiler/utils/FastString.lhs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/utils/FastString.lhs b/compiler/utils/FastString.lhs index 6924629b48..9131ca2fde 100644 --- a/compiler/utils/FastString.lhs +++ b/compiler/utils/FastString.lhs @@ -572,13 +572,10 @@ mkLitString s = p <- mallocBytes (length s + 1) let loop :: Int -> String -> IO () - loop n cs | n `seq` null cs = pokeByteOff p n (0 :: Word8) + loop !n [] = pokeByteOff p n (0 :: Word8) loop n (c:cs) = do pokeByteOff p n (fromIntegral (ord c) :: Word8) loop (1+n) cs - -- XXX GHC isn't smart enough to know that we have already covered - -- this case. - loop _ [] = panic "mkLitString" loop 0 s return p ) |