Mercurial > lbo > hg > photosync
changeset 22:73c46c201c7c
Replace map with iterator comprehension
author | Lewin Bormann <lewin@lewin-bormann.info> |
---|---|
date | Mon, 23 Sep 2019 12:44:53 +0200 |
parents | 35a21ae7a8f7 |
children | 2ec82615c664 |
files | photosync.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/photosync.py Thu Aug 15 21:57:35 2019 +0200 +++ b/photosync.py Mon Sep 23 12:44:53 2019 +0200 @@ -121,7 +121,7 @@ Returns: List of IDs that were successfully downloaded. """ - ids = list(map(lambda i: i[0], items)) + ids = [i[0] for i in items] media_items = self._service.mediaItems().batchGet(mediaItemIds=ids).execute() ok = [] i = -1 @@ -304,7 +304,7 @@ if len(chunk) > chunksize: ok = self._svc.download_items(chunk) self._db.mark_items_downloaded(ok) - wantids = set(map(lambda i: i[0], chunk)) + wantids = set(i[0] for i in chunk) missing = wantids ^ set(ok) for item in chunk: if item[0] in missing: