]> Git Repo - qemu.git/commitdiff
qapi-visit: Replace list implicit_structs by set
authorMarkus Armbruster <[email protected]>
Tue, 30 Jun 2015 07:27:04 +0000 (09:27 +0200)
committerMarkus Armbruster <[email protected]>
Fri, 4 Sep 2015 13:47:14 +0000 (15:47 +0200)
Use set because that's what it is.  While there, rename to
implicit_structs_seen.

Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
scripts/qapi-visit.py

index b3a308fb51ad5e8cb22db94f37bb3d6d83b75c82..9fc040e0f67c3a1847da694bce3e76bfe61ef318 100644 (file)
@@ -16,14 +16,13 @@ from ordereddict import OrderedDict
 from qapi import *
 import re
 
-implicit_structs = []
+implicit_structs_seen = set()
 struct_fields_seen = set()
 
 def generate_visit_implicit_struct(type):
-    global implicit_structs
-    if type in implicit_structs:
+    if type in implicit_structs_seen:
         return ''
-    implicit_structs.append(type)
+    implicit_structs_seen.add(type)
     ret = ''
     if type not in struct_fields_seen:
         # Need a forward declaration
This page took 0.026549 seconds and 4 git commands to generate.