Patchwork [v3,1/3] qapi: cleanup redundant variable

login
register
mail settings
Submitter Amos Kong
Date Jan. 5, 2014, 12:02 p.m.
Message ID <1388923351-10556-2-git-send-email-akong@redhat.com>
Download mbox | patch
Permalink /patch/306952/
State New
Headers show

Comments

Amos Kong - Jan. 5, 2014, 12:02 p.m.
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(-)

Patch

diff --git a/scripts/qapi.py b/scripts/qapi.py
index 750e9fb..4263bbd 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -165,8 +165,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'])
@@ -175,9 +173,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
 
 def parse_args(typeinfo):
     if isinstance(typeinfo, basestring):