]> code.delx.au - offlineimap/commitdiff
Fixed deletion logic
authorJohn Goerzen <jgoerzen@complete.org>
Wed, 28 May 2008 09:52:08 +0000 (04:52 -0500)
committerJohn Goerzen <jgoerzen@complete.org>
Wed, 28 May 2008 09:52:08 +0000 (04:52 -0500)
src/Data/Syncable.hs

index 6b0f788b65507b39472f12a7281966c81673aac1..9a523e96769b5dde4670229ca61897eca64eaec5 100644 (file)
@@ -92,13 +92,13 @@ syncThem masterstate childstate lastchildstate =
                          (map CopyItem .
                           findAdded masterstate childstate $ lastchildstate)
 
-{- | Returns a list of keys that exist in state1 and lastchildstate
+{- | Returns a list of keys that exist in state2 and lastchildstate
 but not in state2 -}
 findDeleted :: Ord k =>
                SyncCollection k -> SyncCollection k -> SyncCollection k ->
                [k]
-findDeleted state1 state2 lastchildstate =
-    Map.keys . Map.difference state2 . Map.difference state1 $ lastchildstate
+findDeleted state2 state1 lastchildstate =
+    Map.keys . Map.difference (Map.intersection state1 lastchildstate) $ state2
 
 {- | Returns a list of keys that exist in state1 but in neither 
 state2 nor lastchildstate -}