summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2016-07-04 20:33:57 -0400
committerBen Gamari <ben@smart-cactus.org>2016-07-05 09:56:34 +0200
commit84b135695d79c2c416b7746ebad8f39f9d2ab57e (patch)
tree64c9e3f95fb250ab5ad899aa78669b80585587e8
parentdd3080fe0263082f65bf2570f49189c277b12e28 (diff)
downloadhaskell-wip/T12357-concat.tar.gz
FastString: Reduce allocations of concatFSwip/T12357-concat
Instead of unpacking and then repacking we simply concatenate all of the individual ByteStrings.
-rw-r--r--compiler/utils/FastString.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/utils/FastString.hs b/compiler/utils/FastString.hs
index 40c3882b87..407c185ee8 100644
--- a/compiler/utils/FastString.hs
+++ b/compiler/utils/FastString.hs
@@ -513,7 +513,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"