simplify cache generation
don't use lambda to filter. this is 25% faster but really negligible. Change-Id: Ib76470fc3a5cdfc79e497d568147b66c08e6dba1
This commit is contained in:
parent
bd464f1f57
commit
8e3ba4d709
|
@ -461,8 +461,8 @@ class GnocchiPublisher(publisher.ConfigPublisherBase):
|
|||
|
||||
def _check_resource_cache(self, key, resource_data):
|
||||
cached_hash = self.cache.get(key)
|
||||
attribute_hash = hash(frozenset(filter(lambda x: x[0] != "metrics",
|
||||
resource_data.items())))
|
||||
attribute_hash = hash(tuple(i for i in resource_data.items()
|
||||
if i[0] != 'metrics'))
|
||||
if not cached_hash or cached_hash != attribute_hash:
|
||||
return attribute_hash
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue