Received: from eggs.gnu.org ([2001:4830:134:3::10]:44116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9XCP-0000rt-U3 for qemu-devel@nongnu.org; Sat, 01 Feb 2014 04:49:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9XCK-0006mV-CN for qemu-devel@nongnu.org; Sat, 01 Feb 2014 04:49:17 -0500 Message-ID: <52ECC317.5060004@msgid.tls.msk.ru> Date: Sat, 01 Feb 2014 13:49:11 +0400 From: Michael Tokarev MIME-Version: 1.0 References: <1390467277-16499-1-git-send-email-akong@redhat.com> In-Reply-To: <1390467277-16499-1-git-send-email-akong@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] qapi: cleanup redundant variable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org 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(-) > > diff --git a/scripts/qapi.py b/scripts/qapi.py > index 7b92689..718f1ad 100644 > --- a/scripts/qapi.py > +++ b/scripts/qapi.py > @@ -175,8 +175,6 @@ def parse_schema(fp): > print >>sys.stderr, e > exit(1) > > - exprs = [] > - > for expr in schema.exprs: > if expr.has_key('enum'): > add_enum(expr['enum']) > @@ -185,9 +183,8 @@ def parse_schema(fp): > add_enum('%sKind' % expr['union']) > elif expr.has_key('type'): > add_struct(expr) > - exprs.append(expr) > > - return exprs > + return schema.exprs 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? Thanks, /mjt