From: Carl N. Baldwin Date: Wed, 26 Oct 2005 03:44:45 +0000 (-0600) Subject: INTERSECTION not union X-Git-Tag: release-0.4~56 X-Git-Url: http://git.pippins.net/embedvideo/.git/%22%22.%24thumbnail.%22/%7Blink_visit%7D?a=commitdiff_plain;h=57e1b1e3e188c9ad22ef891cdd38e83a094ece39;p=backups%2F.git INTERSECTION not union --- diff --git a/main.cpp b/main.cpp index 3a86a2b..fb7d522 100644 --- a/main.cpp +++ b/main.cpp @@ -64,25 +64,25 @@ void partition_sets( const SET ¤t, const SET &old, SET &added, SET &common, SET &old_common, SET &deleted ) { FileDataNameCmp cmp; - set_difference( current.begin(), current.end(), - old.begin(), old.end(), - inserter( added, added.begin() ), - cmp ); - - set_difference( old.begin(), old.end(), - current.begin(), current.end(), - inserter( deleted, deleted.begin() ), - cmp ); - - set_union( current.begin(), current.end(), - old.begin(), old.end(), - inserter( common, common.begin() ), - cmp ); - - set_union( old.begin(), old.end(), - common.begin(), common.end(), - inserter( old_common, old_common.begin() ), - cmp ); + set_difference( current.begin(), current.end(), + old.begin(), old.end(), + inserter( added, added.begin() ), + cmp ); + + set_difference( old.begin(), old.end(), + current.begin(), current.end(), + inserter( deleted, deleted.begin() ), + cmp ); + + set_intersection( current.begin(), current.end(), + old.begin(), old.end(), + inserter( common, common.begin() ), + cmp ); + + set_intersection( old.begin(), old.end(), + common.begin(), common.end(), + inserter( old_common, old_common.begin() ), + cmp ); } template