From: Michael Tokarev <mjt@tls.msk.ru>
To: Amos Kong <akong@redhat.com>
Cc: qemu-trivial@nongnu.org, eblake@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [PATCH] qapi: cleanup redundant variable
Date: Sat, 01 Feb 2014 13:49:11 +0400 [thread overview]
Message-ID: <52ECC317.5060004@msgid.tls.msk.ru> (raw)
In-Reply-To: <1390467277-16499-1-git-send-email-akong@redhat.com>
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 <akong@redhat.com>
> ---
> 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
WARNING: multiple messages have this Message-ID (diff)
From: Michael Tokarev <mjt@tls.msk.ru>
To: Amos Kong <akong@redhat.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] qapi: cleanup redundant variable
Date: Sat, 01 Feb 2014 13:49:11 +0400 [thread overview]
Message-ID: <52ECC317.5060004@msgid.tls.msk.ru> (raw)
In-Reply-To: <1390467277-16499-1-git-send-email-akong@redhat.com>
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 <akong@redhat.com>
> ---
> 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
next prev parent reply other threads:[~2014-02-01 9:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-23 8:54 [Qemu-trivial] [PATCH] qapi: cleanup redundant variable Amos Kong
2014-01-23 8:54 ` [Qemu-devel] " Amos Kong
2014-02-01 9:49 ` Michael Tokarev [this message]
2014-02-01 9:49 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2014-02-03 18:23 ` Eric Blake
2014-02-03 18:23 ` [Qemu-devel] " Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52ECC317.5060004@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=akong@redhat.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.