aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi.py
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-11-18 01:52:43 -0700
committerMarkus Armbruster <armbru@redhat.com>2015-12-17 08:21:26 +0100
commit23a4b2c6f19297cd067455c852b4874879594c13 (patch)
tree00440f6d87a820639d282ffc6bef5e6741c8ceea /scripts/qapi.py
parent08683353fc46b5d462199c9e8cff6f6c67f20f65 (diff)
qapi: Eliminate QAPISchemaObjectType.check() variable members
We can use seen.values() instead if we make it an OrderedDict. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1446559499-26984-5-git-send-email-armbru@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1447836791-369-9-git-send-email-eblake@redhat.com>
Diffstat (limited to 'scripts/qapi.py')
-rw-r--r--scripts/qapi.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 86d2adc12f..44d08c11e0 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -977,26 +977,22 @@ class QAPISchemaObjectType(QAPISchemaType):
if self.members:
return
self.members = False # mark as being checked
+ seen = OrderedDict()
if self._base_name:
self.base = schema.lookup_type(self._base_name)
assert isinstance(self.base, QAPISchemaObjectType)
assert not self.base.variants # not implemented
self.base.check(schema)
- members = list(self.base.members)
- else:
- members = []
- seen = {}
- for m in members:
- assert m.name not in seen
- seen[m.name] = m
+ for m in self.base.members:
+ assert m.name not in seen
+ seen[m.name] = m
for m in self.local_members:
m.check(schema)
assert m.name not in seen
seen[m.name] = m
- members.append(m)
if self.variants:
self.variants.check(schema, seen)
- self.members = members
+ self.members = seen.values()
def is_implicit(self):
# See QAPISchema._make_implicit_object_type()