1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

Python compat - iteritems() vs. items()

Always use `items()` and introduce extra `list(...)` call when needed.

Differential Revision: https://reviews.llvm.org/D56257

llvm-svn: 350312
This commit is contained in:
Serge Guelton 2019-01-03 14:12:23 +00:00
parent 8c47edd8ae
commit 0c9eaa5247
3 changed files with 4 additions and 4 deletions

View File

@ -75,7 +75,7 @@ class EnumType(type):
def makeKey(item): def makeKey(item):
return (item[1], item[0]) return (item[1], item[0])
e = [] e = []
for pair in sorted(self._nameMap.iteritems(), key=makeKey): for pair in sorted(self._nameMap.items(), key=makeKey):
e.append(pair) e.append(pair)
return e return e

View File

@ -52,10 +52,10 @@ class PhabObjectCache:
return self.id2PhabObjects[id] return self.id2PhabObjects[id]
def get_ids_in_cache(self): def get_ids_in_cache(self):
return self.id2PhabObjects.keys() return list(self.id2PhabObjects.keys())
def get_objects(self): def get_objects(self):
return self.id2PhabObjects.values() return list(self.id2PhabObjects.values())
DEFAULT_DIRECTORY = "PhabObjectCache" DEFAULT_DIRECTORY = "PhabObjectCache"

View File

@ -183,7 +183,7 @@ def ValidateChecksums(reference_checksums,
if len(new_checksums) != len(reference_checksums): if len(new_checksums) != len(reference_checksums):
return False return False
for proj, checksum in new_checksums.iteritems(): for proj, checksum in new_checksums.items():
# We never computed a checksum for this project. # We never computed a checksum for this project.
if proj not in reference_checksums: if proj not in reference_checksums:
return False return False