qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v9 20/27] qapi: Simplify QAPISchemaObjectTypeVar


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v9 20/27] qapi: Simplify QAPISchemaObjectTypeVariants.check()
Date: Wed, 4 Nov 2015 16:12:56 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 11/04/2015 12:02 PM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
> 
>> From: Markus Armbruster <address@hidden>
>>
>> Avoid the 'if seen' conditional by doing just the essential work
>> here, namely setting self.tag_member for flat unions.
>> Move the rest to callers.
>>
>> Signed-off-by: Markus Armbruster <address@hidden>
>> Message-Id: <address@hidden>
>> [reword commit, rebase to earlier AlternateType.check() changes]
>> Signed-off-by: Eric Blake <address@hidden>
>>
>> ---
>> v9: new patch
>> ---
>>  scripts/qapi.py | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/scripts/qapi.py b/scripts/qapi.py
>> index 3054628..6653c70 100644
>> --- a/scripts/qapi.py
>> +++ b/scripts/qapi.py
>> @@ -988,9 +988,10 @@ class QAPISchemaObjectType(QAPISchemaType):
>>          for m in self.local_members:
>>              m.check(schema)
>>              m.check_clash(seen)
>> +        self.members = seen.values()
>>          if self.variants:
>>              self.variants.check(schema, seen)
>> -        self.members = seen.values()
>> +            assert self.variants.tag_member in self.members
>>
>>      def is_implicit(self):
>>          # See QAPISchema._make_implicit_object_type()
>> @@ -1053,8 +1054,6 @@ class QAPISchemaObjectTypeVariants(object):
>>          # seen is non-empty for unions, empty for alternates
> 
> You added this comment in PATCH 10 to explain the conditional I'm
> dropping here.  Let's drop the comment, too.

Except the comment becomes relevant again in 23/27.  Or maybe I just
move the comment to that point.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]