From 67a102808136462bf7fba4515f551b84b5bc35e4 Mon Sep 17 00:00:00 2001 From: PeterLaemmle Date: Wed, 24 May 2017 19:20:53 +0200 Subject: [PATCH] Update doubleFilter.py Correcting the following issues (https://github.com/Schrolli91/BOSWatch/issues/217) -Consider using enumerate instead of iterating with range and len --- includes/doubleFilter.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/includes/doubleFilter.py b/includes/doubleFilter.py index 8550640..887b074 100644 --- a/includes/doubleFilter.py +++ b/includes/doubleFilter.py @@ -31,12 +31,10 @@ def checkID(typ, data, msg=""): @return: True if check was OK @return: False if double was found """ - global doubleList timestamp = int(time.time()) # Get Timestamp logging.debug("checkID: %s (%s)", data, msg) - for i in range(len(doubleList)): - (xID, xTimestamp, xMsg) = doubleList[i] + for (xID, xTimestamp, xMsg) in doubleList: # given ID found? # return False if the first entry in double_ignore_time is found, we will not check for younger ones... if data == xID and timestamp < xTimestamp + globalVars.config.getint("BOSWatch", "doubleFilter_ignore_time"):