From 82e1e6155404b421a82e1c7b5617b8032fc79b83 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 23 Jul 2011 19:51:19 +0000 Subject: [PATCH] minor speedup --- lib/core/common.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/core/common.py b/lib/core/common.py index a8d1a7d32..a9c5268c0 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2727,7 +2727,13 @@ def isNoneValue(value): if isinstance(value, basestring): return value == "None" elif isinstance(value, (list, tuple)): - return isNoneValue(value[0]) if len(value) == 1 else not any(filter(lambda x: x and x != "None", value)) + if len(value) == 1: + return isNoneValue(value[0]) + else: + for i in xrange(len(value)): + if value[i] and value[i] != "None": + return False + return True elif isinstance(value, dict): return not any(value) else: