From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zw16T-0002yt-E2 for qemu-devel@nongnu.org; Tue, 10 Nov 2015 00:04:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zw16Q-00035q-6v for qemu-devel@nongnu.org; Tue, 10 Nov 2015 00:04:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zw16Q-00035e-1g for qemu-devel@nongnu.org; Tue, 10 Nov 2015 00:04:18 -0500 References: <1446791754-23823-1-git-send-email-eblake@redhat.com> <1446791754-23823-23-git-send-email-eblake@redhat.com> <871tbzibz1.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <56417ACC.3020007@redhat.com> Date: Mon, 9 Nov 2015 22:04:12 -0700 MIME-Version: 1.0 In-Reply-To: <871tbzibz1.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aADOpiwMMe4uUXSBt2TGHGqPPrPOXeOiM" Subject: Re: [Qemu-devel] [PATCH v10 22/30] qapi: Simplify QAPISchemaObjectTypeVariants.check() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aADOpiwMMe4uUXSBt2TGHGqPPrPOXeOiM Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/09/2015 05:38 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> From: Markus Armbruster >> >> 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 =3D seen[self.tag_name] >=20 > My patch has: >=20 > - if self.tag_name: # flat union > + if not self.tag_member: # flat union > self.tag_member =3D seen[self.tag_name] >=20 > Any particular reason for dropping it? Not really; I couldn't find anything in later patches that cared either w= ay. >=20 > 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --aADOpiwMMe4uUXSBt2TGHGqPPrPOXeOiM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWQXrMAAoJEKeha0olJ0NqtZIH/AzyatOJzmj1BVgBQNTTPjPj UAMn3PG9aXKkUZhQk8/pIlcwgD1DhDZgbSNi04Caul1rh+EnqRFalW8M3TKG+8RB +W5rYbH+smchfMxIxLdXqAebnXLdGCpLwibNFwXLl/Cq4Q4gtZt5Gj/q476vpYip B+Rnd3gGa9AVZPVPFu6rSV7yx8mT0OkGoBJvKAjTIzTkeQVAMfahaRI4xrnn7qCC /vZ/r+rtuBuQMum/dqzOckmFPnIEE2NLk0ZbZaip2wUZ4kLST3gRFa7VfiwLMIg4 yTPQniPSQGdlGO2Cf3O+iDH0RMjUmtn9UXFNoT1dJcTiwc2OlGezuK7Vx1XLeL0= =aWgC -----END PGP SIGNATURE----- --aADOpiwMMe4uUXSBt2TGHGqPPrPOXeOiM--