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 /Logs/MapLog.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 'Logs/MapLog.hs')
-rw-r--r-- | Logs/MapLog.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Logs/MapLog.hs b/Logs/MapLog.hs index a881eae34..74ddee582 100644 --- a/Logs/MapLog.hs +++ b/Logs/MapLog.hs @@ -7,6 +7,7 @@ - A line of the log will look like: "timestamp field value" - - Copyright 2014 Joey Hess <id@joeyh.name> + - Copyright 2022 Benjamin Barenblat <bbarenblat@gmail.com> - - Licensed under the GNU GPL version 3 or higher. -} @@ -21,7 +22,7 @@ import Common import Annex.VectorClock import Logs.Line -import qualified Data.Map as M +import qualified Data.Map.Strict as M data LogEntry v = LogEntry { changed :: VectorClock @@ -56,7 +57,7 @@ changeMapLog c f v = M.insert f $ LogEntry c v {- Only add an LogEntry if it's newer (or at least as new as) than any - existing LogEntry for a field. -} addMapLog :: Ord f => f -> LogEntry v -> MapLog f v -> MapLog f v -addMapLog = M.insertWith' best +addMapLog = M.insertWith best {- Converts a MapLog into a simple Map without the timestamp information. - This is a one-way trip, but useful for code that never needs to change |