Minor refactoring

This commit is contained in:
Miroslav Stampar
2017-11-24 11:44:14 +01:00
parent b23626db70
commit b9e2e8b74d
3 changed files with 8 additions and 11 deletions

View File

@@ -461,15 +461,12 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
threadData = getCurrentThreadData()
while kb.threadContinue:
kb.locks.index.acquire()
with kb.locks.index:
if threadData.shared.index[0] - firstChar >= length:
return
if threadData.shared.index[0] - firstChar >= length:
kb.locks.index.release()
return
threadData.shared.index[0] += 1
currentCharIndex = threadData.shared.index[0]
kb.locks.index.release()
threadData.shared.index[0] += 1
currentCharIndex = threadData.shared.index[0]
if kb.threadContinue:
charStart = time.time()