From e07a5b1909d26d6a28910002daf1c0ea21e05ea3 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Wed, 21 Apr 2010 10:57:17 -0700 Subject: Simplify _findVar a bit (Bitbake rev: b017acd39b811a00305002a8044e7d02e79f41d7) Signed-off-by: Chris Larson Signed-off-by: Richard Purdie --- bitbake/lib/bb/data_smart.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 48f401618..01a333024 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py @@ -164,17 +164,14 @@ class DataSmart: self.dict[var] = {} def _findVar(self, var): - _dest = self.dict + dest = self.dict + while dest: + if var in dest: + return dest[var] - while (_dest and var not in _dest): - if not "_data" in _dest: - _dest = None + if "_data" not in dest: break - _dest = _dest["_data"] - - if _dest and var in _dest: - return _dest[var] - return None + dest = dest["_data"] def _makeShadowCopy(self, var): if var in self.dict: -- cgit v1.2.3