From e305869fac560855f0e4b15ec6d03d8ec5c7205f Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sat, 12 Aug 2017 16:26:16 +0200 Subject: [PATCH] Simplify code a little --- vdirsyncer/sync.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vdirsyncer/sync.py b/vdirsyncer/sync.py index 28ae069..1e666fb 100644 --- a/vdirsyncer/sync.py +++ b/vdirsyncer/sync.py @@ -464,16 +464,15 @@ class _StorageInfo(object): prefetch = [] def _store_props(ident, props): - nonlocal storage_nonempty - storage_nonempty = True - try: self.status.insert_ident(ident, props) except _IdentAlreadyExists as e: raise e.to_ident_conflict(self.storage) for href, etag in self.storage.list(): + storage_nonempty = True ident, meta = self.status.get_by_href(href) + if meta is None or meta.href != href or meta.etag != etag: # Either the item is completely new, or updated # In both cases we should prefetch