[poky] About the operator "??="

Richard Purdie rpurdie at linux.intel.com
Fri Dec 10 15:42:01 PST 2010


On Thu, 2010-12-09 at 22:44 +0800, Xu, Dongxiao wrote:
> I made the following patch (setVarFlag.patch) to move everything in
> setVar to setVarFlag, please help to review it.
> 
> Please note one place that I modified, see the indent of
> "self._seen_overrides[override].add( var )", I thought it was a bug in
> original code.

No, its not. Its making sure [override] exists before trying to add var
to it. It could also be:

if override not in self._seen_overrides:
    self._seen_overrides[override] = set(var)
else:
    self._seen_overrides[override].add( var )

> After adding this, the "two lines" in original "??=" optimization
> patch are no longer needed.
> 
> +            if bb.data.getVarFlag(key, "content", data) is None:
> +                bb.data.setVar(key, None, data)
> 
> I rerun "time bitbake -p" with the two patches (see below, one is
> setVarFlag.patch, another is the "??=" optimization patch)
> The result is:
> 
> real    0m27.049s
> user    0m26.340s
> sys     0m0.440s
> 
> The parsing time is a bit longer ( < 1 sec) than without the following
> "setVarFlag.patch".

Patches look good to me other than the above. I also talked to Chris on
irc on #oe earlier today and we agreed this is a good move for setVar
bringing both into line although the whole way the datastore works could
still be better.

Could you send these patches through a pull request please and lets get
them merged.

Cheers,

Richard






More information about the poky mailing list