From b58049b4e70f896ec60f3f35c28e55b15db3039c Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 16 Mar 2022 13:57:33 +0000 Subject: bitbake: data_smart: Avoid multiple getVarFlag calls We can call getVarFlags() instead of the multiple getVarFlag calls which is a little more efficient. This reduces the number of overall function calls so is good but probably isn't much faster (or slower). (Bitbake rev: 505a4dd34e822bdf902d9b348dbcdf5b2c94e784) Signed-off-by: Richard Purdie --- bitbake/lib/bb/data_smart.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bitbake/lib/bb/data_smart.py') diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index ca78d84133..dd20ca557e 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py @@ -673,10 +673,11 @@ class DataSmart(MutableMapping): self.varhistory.record(**loginfo) self.setVar(newkey, val, ignore=True, parsing=True) - for i in (__setvar_keyword__): - src = self.getVarFlag(key, i, False) - if src is None: + srcflags = self.getVarFlags(key, False, True) or {} + for i in srcflags: + if i not in (__setvar_keyword__): continue + src = srcflags[i] dest = self.getVarFlag(newkey, i, False) or [] dest.extend(src) -- cgit v1.2.3-54-g00ecf