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 <ak...@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