diff options
author | Joey Hess <joey@kitenet.net> | 2014-01-07 14:55:06 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-01-07 14:55:06 -0400 |
commit | 05d95044cdf97d572ffcf601ea98561057d28f3e (patch) | |
tree | 7348a470c4245a9f7b89c3fbf01c0772a4ff96e4 /Assistant | |
parent | 04d48f98c5cecabdefcddc8b68738567a530dd84 (diff) |
revert use of Data.Map.Strict
memory profile shows this did not contribute to the memory leaks fixed in
4cf6d95c1a9d10cb59669eaceafce4c7a3155eb6
Diffstat (limited to 'Assistant')
-rw-r--r-- | Assistant/Alert/Utility.hs | 4 | ||||
-rw-r--r-- | Assistant/DaemonStatus.hs | 4 | ||||
-rw-r--r-- | Assistant/ScanRemotes.hs | 2 | ||||
-rw-r--r-- | Assistant/TransferQueue.hs | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/Assistant/Alert/Utility.hs b/Assistant/Alert/Utility.hs index 960c3385b..db2ea1925 100644 --- a/Assistant/Alert/Utility.hs +++ b/Assistant/Alert/Utility.hs @@ -13,7 +13,7 @@ import Utility.Tense import qualified Data.Text as T import Data.Text (Text) -import qualified Data.Map.Strict as M +import qualified Data.Map as M {- This is as many alerts as it makes sense to display at a time. - A display might be smaller, or larger, the point is to not overwhelm the @@ -122,7 +122,7 @@ mergeAlert i al m = maybe updatePrune updateCombine (alertCombiner al) let (f, rest) = partition (\(_, a) -> isFiller a) l in drop bloat f ++ rest updatePrune = pruneBloat $ M.filterWithKey pruneSame $ - M.insert i al m + M.insertWith' const i al m updateCombine combiner = let combined = M.mapMaybe (combiner al) m in if M.null combined diff --git a/Assistant/DaemonStatus.hs b/Assistant/DaemonStatus.hs index fc607767b..b9ad975b0 100644 --- a/Assistant/DaemonStatus.hs +++ b/Assistant/DaemonStatus.hs @@ -25,7 +25,7 @@ import System.Posix.Types import Data.Time.Clock.POSIX import Data.Time import System.Locale -import qualified Data.Map.Strict as M +import qualified Data.Map as M import qualified Data.Text as T getDaemonStatus :: Assistant DaemonStatus @@ -171,7 +171,7 @@ alterTransferInfo t a = updateTransferInfo' $ M.adjust a t - or if already present, updates it while preserving the old transferTid, - transferPaused, and bytesComplete values, which are not written to disk. -} updateTransferInfo :: Transfer -> TransferInfo -> Assistant () -updateTransferInfo t info = updateTransferInfo' $ M.insertWith merge t info +updateTransferInfo t info = updateTransferInfo' $ M.insertWith' merge t info where merge new old = new { transferTid = maybe (transferTid new) Just (transferTid old) diff --git a/Assistant/ScanRemotes.hs b/Assistant/ScanRemotes.hs index 79df2e123..2743c0f36 100644 --- a/Assistant/ScanRemotes.hs +++ b/Assistant/ScanRemotes.hs @@ -13,7 +13,7 @@ import qualified Types.Remote as Remote import Data.Function import Control.Concurrent.STM -import qualified Data.Map.Strict as M +import qualified Data.Map as M {- Blocks until there is a remote or remotes that need to be scanned. - diff --git a/Assistant/TransferQueue.hs b/Assistant/TransferQueue.hs index 05b0ba73a..98fb2f06c 100644 --- a/Assistant/TransferQueue.hs +++ b/Assistant/TransferQueue.hs @@ -34,7 +34,7 @@ import Annex.Wanted import Utility.TList import Control.Concurrent.STM -import qualified Data.Map.Strict as M +import qualified Data.Map as M import qualified Data.Set as S type Reason = String @@ -191,7 +191,7 @@ getNextTransfer acceptable = do if acceptable info then do adjustTransfersSTM dstatus $ - M.insert t info + M.insertWith' const t info return $ Just r else return Nothing |