[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
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v10 27/30] qapi: Track owner of each object member, (continued)
- [Qemu-devel] [PATCH v10 27/30] qapi: Track owner of each object member, Eric Blake, 2015/11/06
- [Qemu-devel] [PATCH v10 28/30] qapi: Detect collisions in C member names, Eric Blake, 2015/11/06
- [Qemu-devel] [PATCH v10 30/30] qapi: Forbid case-insensitive clashes, Eric Blake, 2015/11/06
- [Qemu-devel] [PATCH v10 22/30] qapi: Simplify QAPISchemaObjectTypeVariants.check(), Eric Blake, 2015/11/06
- [Qemu-devel] [PATCH v10 29/30] cpu: Convert CpuInfo into flat union, Eric Blake, 2015/11/06
[Qemu-devel] [PATCH v10 26/30] qapi: Remove outdated tests related to QMP/branch collisions, Eric Blake, 2015/11/06
[Qemu-devel] [PATCH v10 20/30] qapi: Eliminate QAPISchemaObjectType.check() variable members, Eric Blake, 2015/11/06
Re: [Qemu-devel] [PATCH v10 00/30] qapi member collision (post-introspection cleanups, subset C'), Markus Armbruster, 2015/11/06