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:11:03 +0100 |
commit | 43c670accc077d4fc2b52382a45d4bf745285253 (patch) | |
tree | a0497061e2a3ec52797f52d937b3a4c44a3aa852 /bitbake/lib/bb | |
parent | 602bb695cfa4b90f3c35800ffacbf50e71db4cd0 (diff) | |
download | poky-43c670accc077d4fc2b52382a45d4bf745285253.tar.gz |
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>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/data.py | 2 |
1 files changed, 1 insertions, 1 deletions
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(): | |||
59 | def init_db(parent = None): | 59 | def init_db(parent = None): |
60 | """Return a new object representing the Bitbake data, | 60 | """Return a new object representing the Bitbake data, |
61 | optionally based on an existing object""" | 61 | optionally based on an existing object""" |
62 | if parent: | 62 | if parent is not None: |
63 | return parent.createCopy() | 63 | return parent.createCopy() |
64 | else: | 64 | else: |
65 | return _dict_type() | 65 | return _dict_type() |