From e09bc2406c643add2b33e262457471bc6c754ee3 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 20 Dec 2010 19:24:20 +0000 Subject: [PATCH] minor refactoring --- lib/core/common.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 2496c7c69..9961b5253 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1529,12 +1529,15 @@ def longestCommonPrefix(*sequences): def commonFinderOnly(initial, sequence): return longestCommonPrefix(*filter(lambda x: x.startswith(initial), sequence)) +def getCurrentThreadID(): + return threading.currentThread().ident + def pushValue(value): """ Push value to the stack """ - threadId = threading.currentThread().ident + threadId = getCurrentThreadID() if threadId not in kb.valueStack: kb.valueStack[threadId] = [] kb.valueStack[threadId].append(value) @@ -1544,7 +1547,7 @@ def popValue(): Pop value from the stack """ - return kb.valueStack[threading.currentThread().ident].pop() + return kb.valueStack[getCurrentThreadID()].pop() def wasLastRequestDBMSError(): """