mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 13:49:49 +00:00
bitbake: codeparser: Small optimisation to stop repeated hash() calls
No functionality change, just avoids function call overhead in a function which loops heavily. (Bitbake rev: 633c0c19f87a92497a7e9771811cdc953e1b7047) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -65,9 +65,10 @@ class SetCache(object):
|
|||||||
for i in items:
|
for i in items:
|
||||||
new.append(sys.intern(i))
|
new.append(sys.intern(i))
|
||||||
s = frozenset(new)
|
s = frozenset(new)
|
||||||
if hash(s) in self.setcache:
|
h = hash(s)
|
||||||
return self.setcache[hash(s)]
|
if h in self.setcache:
|
||||||
self.setcache[hash(s)] = s
|
return self.setcache[h]
|
||||||
|
self.setcache[h] = s
|
||||||
return s
|
return s
|
||||||
|
|
||||||
codecache = SetCache()
|
codecache = SetCache()
|
||||||
|
|||||||
Reference in New Issue
Block a user