allM has slightly better memory use

This commit is contained in:
Joey Hess 2014-07-26 22:34:10 -04:00
parent 67975bf50d
commit 86e8532c0a

View file

@ -154,7 +154,7 @@ toChunkList k (chunksize, chunkcount) = takeChunkKeyStream chunkcount $
removeChunks :: (Key -> Annex Bool) -> UUID -> ChunkConfig -> EncKey -> Key -> Annex Bool removeChunks :: (Key -> Annex Bool) -> UUID -> ChunkConfig -> EncKey -> Key -> Annex Bool
removeChunks remover u chunkconfig encryptor k = do removeChunks remover u chunkconfig encryptor k = do
ls <- chunkKeys u chunkconfig k ls <- chunkKeys u chunkconfig k
ok <- and <$> mapM (remover . encryptor) (concat ls) ok <- allM (remover . encryptor) (concat ls)
when ok $ when ok $
case chunkconfig of case chunkconfig of
(UnpaddedChunks _) | not (isChunkKey k) -> do (UnpaddedChunks _) | not (isChunkKey k) -> do