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 <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2013-09-16 07:13:38 +00:00
parent 602bb695cf
commit 43c670accc
1 changed files with 1 additions and 1 deletions

View File

@ -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()