From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAOAw-0005Iw-Su for qemu-devel@nongnu.org; Mon, 03 Feb 2014 13:23:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAOAs-0004jY-0S for qemu-devel@nongnu.org; Mon, 03 Feb 2014 13:23:18 -0500 Message-ID: <52EFDE8D.4030701@redhat.com> Date: Mon, 03 Feb 2014 11:23:09 -0700 From: Eric Blake MIME-Version: 1.0 References: <1390467277-16499-1-git-send-email-akong@redhat.com> <52ECC317.5060004@msgid.tls.msk.ru> In-Reply-To: <52ECC317.5060004@msgid.tls.msk.ru> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IPDEG66fIGRShhmqQvv8lBXUpr0J9vndc" Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] qapi: cleanup redundant variable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev , Amos Kong Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IPDEG66fIGRShhmqQvv8lBXUpr0J9vndc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/01/2014 02:49 AM, Michael Tokarev wrote: > 23.01.2014 12:54, Amos Kong wrote: >> No need to re-append an expr list, it's ok to return schema.exprs >> >> Signed-off-by: Amos Kong >> --- >> scripts/qapi.py | 5 +---- >> 1 file changed, 1 insertion(+), 4 deletions(-) >> @@ -185,9 +183,8 @@ def parse_schema(fp): >> add_enum('%sKind' % expr['union']) >> elif expr.has_key('type'): >> add_struct(expr) >> - exprs.append(expr) >> =20 >> - return exprs >> + return schema.exprs >=20 > I don't really know python. Does it mean that previously, > this function returned a copy of schema.exprs, but now it > returns schema.exprs itself, so a caller can modify it? My python is also weak (hence my lack of R-b), but yes, I believe you are correct. On the other hand, parse_schema is only called up front, so I don't think callers are modifying the return value anyways, so does it matter? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --IPDEG66fIGRShhmqQvv8lBXUpr0J9vndc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJS796NAAoJEKeha0olJ0NqSqAIAI4rzTDrIKWnAPrTJKKKZOt4 RzYQl0sYjYN/d09JCus9EDCi8x7dq505noedH55lqrBCGQRcMjTU8U+p5e7TiEES N10riUHykXc6X70gf8weGST5ov18f4DMNdf1QUipdyND38KSSRrVcMm5TuqnFLyM 5I9ZC2iTtLnsHwijeP+6YagZbkcqYwCWzrmpSgS1Wp7DUgMSx/eOSuN7aB6G19WB gL6AWAWoS5sCO9HbHAK4f7G2PvcN+NFMGbgc0TyeJ9PeAi8kHr5zbRCRHPrjJD39 Wm5w47zxx9pBqyM6dZQfncjCmcoudrHF/OfWcctlUrnx0CGmIxL36LIZYdcdHnU= =H/ud -----END PGP SIGNATURE----- --IPDEG66fIGRShhmqQvv8lBXUpr0J9vndc--