qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v10 22/30] qapi: Simplify QAPISchemaObjectTypeVa


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v10 22/30] qapi: Simplify QAPISchemaObjectTypeVariants.check()
Date: Mon, 9 Nov 2015 22:04:12 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 11/09/2015 05:38 AM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
> 
>> From: Markus Armbruster <address@hidden>
>>
>> Reduce the ugly flat union / simple union conditional by doing just
>> the essential work here, namely setting self.tag_member.
>> Move the rest to callers.
>>

>> @@ -1052,8 +1053,6 @@ class QAPISchemaObjectTypeVariants(object):
>>      def check(self, schema, seen):
>>          if self.tag_name:    # flat union
>>              self.tag_member = seen[self.tag_name]
> 
> My patch has:
> 
>   -        if self.tag_name:    # flat union
>   +        if not self.tag_member: # flat union
>                self.tag_member = seen[self.tag_name]
> 
> Any particular reason for dropping it?

Not really; I couldn't find anything in later patches that cared either way.

> 
> I like my change, because I feel it makes the assignment's purpose more
> obvious: ensure .tag_member is set.

Sure, we'll go with your approach.

-- 
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]