summaryrefslogtreecommitdiff
path: root/compiler/utils/FastString.lhs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-07-15 00:39:47 +0100
committerIan Lynagh <igloo@earth.li>2012-07-15 00:39:47 +0100
commit2b44d34b87359f33d80035daad3449f5ac3280c4 (patch)
tree3bea9f08936f964b2d03d445d574b6ac24fac6b6 /compiler/utils/FastString.lhs
parentc64a39a068f7b9d9b18417b31c7580f734c91b0e (diff)
downloadhaskell-2b44d34b87359f33d80035daad3449f5ac3280c4.tar.gz
Small refactoring
Diffstat (limited to 'compiler/utils/FastString.lhs')
-rw-r--r--compiler/utils/FastString.lhs5
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
)