Update doubleFilter.py

Correcting the following issues (https://github.com/Schrolli91/BOSWatch/issues/217)
-Consider using enumerate instead of iterating with range and len
This commit is contained in:
PeterLaemmle 2017-05-24 19:20:53 +02:00 committed by GitHub
parent 3ce29711a1
commit 67a1028081

View file

@ -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"):