summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2015-08-06 16:32:22 -0700
committerDylan Baker <baker.dylan.c@gmail.com>2015-09-09 11:23:08 -0700
commitaf6628dd6d4e30510f1f03a5bf380612307ffe92 (patch)
treeff7140e02cdcfa83951db8b9ae2c96f1bf00f634 /framework
parent57f912d890ed3732e239c6d8fca0bc0a3ee6a467 (diff)
framework/status.py: Add early return to status_lookup
It's rediculously expensive to send a Status through the status_lookup factory, it's much cheaper to return early, and doesn't really affect non Status lookups. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/status.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/framework/status.py b/framework/status.py
index 51a7e21a6..28f8bfaa6 100644
--- a/framework/status.py
+++ b/framework/status.py
@@ -80,6 +80,11 @@ def status_lookup(status):
does not correspond to a key it will raise an exception
"""
+ # Don't go through this if what we've been passed already is a status, it's
+ # very expensive
+ if isinstance(status, Status):
+ return status
+
status_dict = {
'skip': SKIP,
'pass': PASS,