[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/7] qapi: Eliminate QAPISchemaObjectType.check() va
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH 5/7] qapi: Eliminate QAPISchemaObjectType.check() variable members |
Date: |
Tue, 3 Nov 2015 15:04:57 +0100 |
We can use seen.values() instead if we make it an OrderedDict.
Signed-off-by: Markus Armbruster <address@hidden>
---
scripts/qapi.py | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/scripts/qapi.py b/scripts/qapi.py
index a6fdd76..a46fded 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()
--
2.4.3
- Re: [Qemu-devel] [PATCH v8.5 1/4] qapi: Drop all_members parameter from check(), (continued)
- Re: [Qemu-devel] [PATCH v8.5 1/4] qapi: Drop all_members parameter from check(), Markus Armbruster, 2015/11/03
- Re: [Qemu-devel] [PATCH v8.5 1/4] qapi: Drop all_members parameter from check(), Eric Blake, 2015/11/03
- Re: [Qemu-devel] [PATCH v8.5 1/4] qapi: Drop all_members parameter from check(), Markus Armbruster, 2015/11/03
- Re: [Qemu-devel] [PATCH v8.5 1/4] qapi: Drop all_members parameter from check(), Eric Blake, 2015/11/03
- Re: [Qemu-devel] [PATCH v8.5 1/4] qapi: Drop all_members parameter from check(), Markus Armbruster, 2015/11/03
- Re: [Qemu-devel] [PATCH v8.5 1/4] qapi: Drop all_members parameter from check(), Eric Blake, 2015/11/03
- [Qemu-devel] [PATCH 1/7] qapi: Drop obsolete tag value collision assertions, Markus Armbruster, 2015/11/03
- [Qemu-devel] [PATCH 2/7] qapi: Simplify QAPISchemaObjectTypeMember.check(), Markus Armbruster, 2015/11/03
- [Qemu-devel] [PATCH 7/7] qapi: QAPISchemaObjectTypeVariants.check(), Markus Armbruster, 2015/11/03
- [Qemu-devel] [PATCH 4/7] qapi: Fix up commit 7618b91's clash sanity checking change, Markus Armbruster, 2015/11/03
- [Qemu-devel] [PATCH 5/7] qapi: Eliminate QAPISchemaObjectType.check() variable members,
Markus Armbruster <=
- [Qemu-devel] [PATCH 3/7] qapi: Clean up after previous commit, Markus Armbruster, 2015/11/03
- [Qemu-devel] [PATCH 6/7] qapi: Factor out QAPISchemaObjectTypeMember.check_clash(), Markus Armbruster, 2015/11/03
[Qemu-devel] [PATCH v8.5 2/4] qapi: Check for QMP collisions of flat union branches, Eric Blake, 2015/11/02
[Qemu-devel] [PATCH v8.5 3/4] qapi: Fix check for variant tag values collision, Eric Blake, 2015/11/02
[Qemu-devel] [PATCH v8.5 4/4] qapi: Consolidate collision detection code, Eric Blake, 2015/11/02