From e0316880b42ca5a140264575f16cdc7c55669fa4 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sat, 20 Dec 2014 02:56:35 +0100 Subject: [PATCH] Use helper function --- vdirsyncer/sync.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/vdirsyncer/sync.py b/vdirsyncer/sync.py index fc29f14..9c9772d 100644 --- a/vdirsyncer/sync.py +++ b/vdirsyncer/sync.py @@ -18,6 +18,7 @@ import itertools from . import exceptions, log +from .utils import uniq from .utils.compat import iteritems, text_type sync_logger = log.get(__name__) @@ -265,12 +266,7 @@ def _get_actions(storages, status): storage_a, a_idents = storages['a'] storage_b, b_idents = storages['b'] - handled = set() - for ident in itertools.chain(a_idents, b_idents, status): - if ident in handled: - continue - handled.add(ident) - + for ident in uniq(itertools.chain(a_idents, b_idents, status)): a = a_idents.get(ident, None) b = b_idents.get(ident, None) assert not a or a['etag'] is not None