aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralexwl <alexey.a.kiryushin@gmail.com>2018-12-13 18:31:39 +0300
committeralexwl <alexey.a.kiryushin@gmail.com>2018-12-13 18:31:39 +0300
commit27024fa57469af22d5b39309042f203c7b2efc5e (patch)
treed5043e33da3c30be56b094c9c41092e1a7940f4b /src
parent7488749af2408b6509776cfb54c150a834b55314 (diff)
Replace Vector.fromList with Vector.fromListN
Vector.fromListN allocates less memory and allows to remove the call to Vector.force before compaction ('compact $ Vector.fromList [1,2,3]' crashes, 'compact $ Vector.fromListN 3 [1,2,3]' doesn't crash)
Diffstat (limited to 'src')
-rw-r--r--src/HaskellCodeExplorer/Types.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/HaskellCodeExplorer/Types.hs b/src/HaskellCodeExplorer/Types.hs
index f94b3af..a21a483 100644
--- a/src/HaskellCodeExplorer/Types.hs
+++ b/src/HaskellCodeExplorer/Types.hs
@@ -549,7 +549,7 @@ instance Serialize IdentifierOccurrenceSort
instance Serialize TypeComponent
instance (Serialize a) => Serialize (V.Vector a) where
put = put . V.toList
- get = V.fromList <$> get
+ get = (\l -> V.fromListN (L.length l) l) <$> get
instance Serialize Type
instance Serialize ExpressionInfo
instance Serialize LocatableEntity