diff options
author | Ben Gamari <ben@smart-cactus.org> | 2016-07-04 20:33:57 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-07-08 15:06:23 +0200 |
commit | 91fd87e2384091f1872f91953e83b299d8e1478f (patch) | |
tree | 945d836e82b12b2449762ec4788cccbb78d9b992 /compiler/utils | |
parent | b8cd94d631ccccf7c94dda2eceb39650faf7d568 (diff) | |
download | haskell-91fd87e2384091f1872f91953e83b299d8e1478f.tar.gz |
FastString: Reduce allocations of concatFS
Instead of unpacking and then repacking we simply concatenate all of the
individual ByteStrings.
Diffstat (limited to 'compiler/utils')
-rw-r--r-- | compiler/utils/FastString.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/utils/FastString.hs b/compiler/utils/FastString.hs index 237c0a23ca..41889cfdc4 100644 --- a/compiler/utils/FastString.hs +++ b/compiler/utils/FastString.hs @@ -512,7 +512,7 @@ appendFS fs1 fs2 = mkFastStringByteString (fastStringToByteString fs2) concatFS :: [FastString] -> FastString -concatFS ls = mkFastString (Prelude.concat (map unpackFS ls)) -- ToDo: do better +concatFS = mkFastStringByteString . BS.concat . map fs_bs headFS :: FastString -> Char headFS (FastString _ 0 _ _) = panic "headFS: Empty FastString" |