diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-16 07:13:38 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-17 14:09:37 +0100 |
commit | 43a245bde318545ea75ca4ce7894395c1cf9b32a (patch) | |
tree | 4695b0de5c163753b205b3331f011a638c58f804 /lib/bb | |
parent | f8a6e4caed4dc3dcf207aecc4ea5f438027da8be (diff) | |
download | bitbake-contrib-43a245bde318545ea75ca4ce7894395c1cf9b32a.tar.gz |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb')
-rw-r--r-- | lib/bb/data.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/data.py b/lib/bb/data.py index 8c9cb0f02..e6d523210 100644 --- a/lib/bb/data.py +++ b/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() |