Hi
On Tue, Dec 11, 2018 at 4:06 PM Markus Armbruster <armbru@redhat.com> wrote:
>
> Marc-André Lureau <marcandre.lureau@redhat.com> writes:
>
> > The function only receives the dictionary form of enum expressions
> > now, so we can make it shorter.
> >
> > Suggested-by: Markus Armbruster <armbru@redhat.com>
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@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()
>
> We may want to squash this one into PATCH 08 as mentioned in that
> patch's review.
>
> In case we don't:
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>
Feel free to squash on commit, thanks
--
Marc-André Lureau