revert use of Data.Map.Strict
memory profile shows this did not contribute to the memory leaks fixed in
b92b54bd42
This commit is contained in:
parent
281cde87b5
commit
1c8f5f830b
4 changed files with 7 additions and 7 deletions
|
@ -13,7 +13,7 @@ import Utility.Tense
|
||||||
|
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import Data.Text (Text)
|
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.
|
{- 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
|
- 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
|
let (f, rest) = partition (\(_, a) -> isFiller a) l
|
||||||
in drop bloat f ++ rest
|
in drop bloat f ++ rest
|
||||||
updatePrune = pruneBloat $ M.filterWithKey pruneSame $
|
updatePrune = pruneBloat $ M.filterWithKey pruneSame $
|
||||||
M.insert i al m
|
M.insertWith' const i al m
|
||||||
updateCombine combiner =
|
updateCombine combiner =
|
||||||
let combined = M.mapMaybe (combiner al) m
|
let combined = M.mapMaybe (combiner al) m
|
||||||
in if M.null combined
|
in if M.null combined
|
||||||
|
|
|
@ -25,7 +25,7 @@ import System.Posix.Types
|
||||||
import Data.Time.Clock.POSIX
|
import Data.Time.Clock.POSIX
|
||||||
import Data.Time
|
import Data.Time
|
||||||
import System.Locale
|
import System.Locale
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map as M
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
|
|
||||||
getDaemonStatus :: Assistant DaemonStatus
|
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,
|
- or if already present, updates it while preserving the old transferTid,
|
||||||
- transferPaused, and bytesComplete values, which are not written to disk. -}
|
- transferPaused, and bytesComplete values, which are not written to disk. -}
|
||||||
updateTransferInfo :: Transfer -> TransferInfo -> Assistant ()
|
updateTransferInfo :: Transfer -> TransferInfo -> Assistant ()
|
||||||
updateTransferInfo t info = updateTransferInfo' $ M.insertWith merge t info
|
updateTransferInfo t info = updateTransferInfo' $ M.insertWith' merge t info
|
||||||
where
|
where
|
||||||
merge new old = new
|
merge new old = new
|
||||||
{ transferTid = maybe (transferTid new) Just (transferTid old)
|
{ transferTid = maybe (transferTid new) Just (transferTid old)
|
||||||
|
|
|
@ -13,7 +13,7 @@ import qualified Types.Remote as Remote
|
||||||
|
|
||||||
import Data.Function
|
import Data.Function
|
||||||
import Control.Concurrent.STM
|
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.
|
{- Blocks until there is a remote or remotes that need to be scanned.
|
||||||
-
|
-
|
||||||
|
|
|
@ -34,7 +34,7 @@ import Annex.Wanted
|
||||||
import Utility.TList
|
import Utility.TList
|
||||||
|
|
||||||
import Control.Concurrent.STM
|
import Control.Concurrent.STM
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map as M
|
||||||
import qualified Data.Set as S
|
import qualified Data.Set as S
|
||||||
|
|
||||||
type Reason = String
|
type Reason = String
|
||||||
|
@ -191,7 +191,7 @@ getNextTransfer acceptable = do
|
||||||
if acceptable info
|
if acceptable info
|
||||||
then do
|
then do
|
||||||
adjustTransfersSTM dstatus $
|
adjustTransfersSTM dstatus $
|
||||||
M.insert t info
|
M.insertWith' const t info
|
||||||
return $ Just r
|
return $ Just r
|
||||||
else return Nothing
|
else return Nothing
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue