From 27024fa57469af22d5b39309042f203c7b2efc5e Mon Sep 17 00:00:00 2001 From: alexwl Date: Thu, 13 Dec 2018 18:31:39 +0300 Subject: 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) --- app/Server.hs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'app/Server.hs') diff --git a/app/Server.hs b/app/Server.hs index f6e1d6d..3bfebd8 100644 --- a/app/Server.hs +++ b/app/Server.hs @@ -374,15 +374,9 @@ loadPackageInfo config path = ( updateEachModuleInfo packageInfo (\modInfo -> - let source = - HCE.source :: HCE.CompactModuleInfo -> V.Vector T.Text - in if not enableExpressionInfo - then modInfo - { HCE.exprInfoMap = IVM.empty - , HCE.source = V.force $ source modInfo - -- 'force' fixes this error: Data.Vector.Mutable: uninitialised element CallStack (from HasCallStack): error, called at ./Data/Vector/Mutable.hs:188:17 in vector-0.12.0.1-GGZqQZyzchy8YFPCF67wxL:Data.Vector.Mutable - } - else modInfo {HCE.source = V.force $ source modInfo}) + if not enableExpressionInfo + then modInfo {HCE.exprInfoMap = IVM.empty} + else modInfo) , path) Left e -> return . Left $ (e, path) -- cgit v1.2.3