From 43c670accc077d4fc2b52382a45d4bf745285253 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 16 Sep 2013 07:13:38 +0000 Subject: [PATCH] bitbake: data: Be explicit in data_db check The if statement current causes the size of parent to be calcuated which is like a len() operation on a datastore. Since we're only interested whether the value is none, checking explictly for this gives a small performance gain. (Bitbake rev: 43a245bde318545ea75ca4ce7894395c1cf9b32a) Signed-off-by: Richard Purdie --- bitbake/lib/bb/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index 8c9cb0f025..e6d523210c 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py @@ -59,7 +59,7 @@ def init(): def init_db(parent = None): """Return a new object representing the Bitbake data, optionally based on an existing object""" - if parent: + if parent is not None: return parent.createCopy() else: return _dict_type()