diff options
author | Benjamin Barenblat <bbarenblat@gmail.com> | 2022-01-19 12:58:54 -0500 |
---|---|---|
committer | Benjamin Barenblat <bbarenblat@gmail.com> | 2022-01-19 13:31:02 -0500 |
commit | 44df82dcbf72d01d2bbb6c0afacff329ca749854 (patch) | |
tree | 2619d3890a9e7e532f0ad19fd5fb4e6579bd0db7 /Assistant/DaemonStatus.hs | |
parent | 0ded71e9a53b1482019aedaa194e913d3a021c8d (diff) |
Eliminate Data.Map.insertWith'
containers-0.6 removed insertWith' in favor of the Data.Map.Strict API.
Switch to the new API where appropriate.
Diffstat (limited to 'Assistant/DaemonStatus.hs')
-rw-r--r-- | Assistant/DaemonStatus.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Assistant/DaemonStatus.hs b/Assistant/DaemonStatus.hs index 49823c3c0..3fafb585d 100644 --- a/Assistant/DaemonStatus.hs +++ b/Assistant/DaemonStatus.hs @@ -1,6 +1,7 @@ {- git-annex assistant daemon status - - Copyright 2012 Joey Hess <id@joeyh.name> + - Copyright 2022 Benjamin Barenblat <bbarenblat@gmail.com> - - Licensed under the GNU GPL version 3 or higher. -} @@ -25,7 +26,7 @@ import Annex.Export import Control.Concurrent.STM import System.Posix.Types import Data.Time.Clock.POSIX -import qualified Data.Map as M +import qualified Data.Map.Strict as M import qualified Data.Set as S getDaemonStatus :: Assistant DaemonStatus @@ -181,7 +182,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) |