The function only receives the dictionary form of enum expressions
now, so we can make it shorter.

Suggested-by: Markus Armbruster <arm...@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com>
---
 scripts/qapi/common.py | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index fd622313cb..44020779dd 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -1714,16 +1714,7 @@ class QAPISchema(object):
                                             qtype_values, 'QTYPE'))
 
     def _make_enum_members(self, values):
-        enum = []
-        for v in values:
-            if isinstance(v, dict):
-                name = v['name']
-                ifcond = v.get('if')
-            else:
-                name = v
-                ifcond = None
-            enum.append(QAPISchemaMember(name, ifcond))
-        return enum
+        return [QAPISchemaMember(v['name'], v.get('if')) for v in values]
 
     def _make_implicit_enum_type(self, name, info, ifcond, values):
         # See also QAPISchemaObjectTypeMember._pretty_owner()
-- 
2.20.0.rc1


Reply via email to