From 8bf6db7fe5e401604b54add1c9a1e5ebffd162cb Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 12 Dec 2019 12:10:08 +0000 Subject: [PATCH] use zip() instead of enumerate() and indexing --- src/core_modules/cron.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core_modules/cron.py b/src/core_modules/cron.py index 40c21bd1..a1078b28 100644 --- a/src/core_modules/cron.py +++ b/src/core_modules/cron.py @@ -23,8 +23,7 @@ class Module(ModuleManager.BaseModule): cron.call(event) def _schedule_match(self, timestamp, schedule): - for i, schedule_part in enumerate(schedule): - timestamp_part = timestamp[i] + for timestamp_part, schedule_part in zip(timestamp, schedule): if not self._schedule_match_part(timestamp_part, schedule_part): return False return True