diff options
author | Joey Hess <joeyh@joeyh.name> | 2018-04-22 13:28:31 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2018-04-22 13:28:31 -0400 |
commit | 256d8f07e810bfd8304b3b00e58d0cbc43671eef (patch) | |
tree | c2fcf7b93861f536c74eb55017b7bf248522adb4 /Logs | |
parent | 558a0a93287db27ffede2c447284722f680c4635 (diff) |
avoid insertWith' depreaction warning
Switch to Data.Map.Strict everywhere that used it.
There are still lots of lazy maps in git-annex. I think switching these
is safe. The risk is that there might be a map that is used in a way
that relies on the values not being evaluated to WHNF, and switching to
strict might result in bad performance or memory use. So, I have not
switched everything.
Diffstat (limited to 'Logs')
-rw-r--r-- | Logs/MapLog.hs | 4 | ||||
-rw-r--r-- | Logs/UUID.hs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Logs/MapLog.hs b/Logs/MapLog.hs index a881eae341..1bc024e2cc 100644 --- a/Logs/MapLog.hs +++ b/Logs/MapLog.hs @@ -21,7 +21,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 +56,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 diff --git a/Logs/UUID.hs b/Logs/UUID.hs index 8da727228b..d3b1e64095 100644 --- a/Logs/UUID.hs +++ b/Logs/UUID.hs @@ -29,7 +29,7 @@ import Logs import Logs.UUIDBased import qualified Annex.UUID -import qualified Data.Map as M +import qualified Data.Map.Strict as M {- Records a description for a uuid in the log. -} describeUUID :: UUID -> String -> Annex () @@ -79,7 +79,7 @@ uuidMapLoad :: Annex UUIDMap uuidMapLoad = do m <- (simpleMap . parseLog Just) <$> Annex.Branch.get uuidLog u <- Annex.UUID.getUUID - let m' = M.insertWith' preferold u "" m + let m' = M.insertWith preferold u "" m Annex.changeState $ \s -> s { Annex.uuidmap = Just m' } return m' where |