diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-06-30 09:27:04 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-09-04 15:47:14 +0200 |
commit | 8c07eddc619d618965fdd7a96bfe3b5c59f42b52 (patch) | |
tree | 266d0b1ada3bbd66cc108cd1e903c7f822de82f4 /scripts | |
parent | 8c3f8e77215bfedb7854221868f655e148506936 (diff) |
qapi-visit: Replace list implicit_structs by set
Use set because that's what it is. While there, rename to
implicit_structs_seen.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/qapi-visit.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py index b3a308fb51..9fc040e0f6 100644 --- a/scripts/qapi-visit.py +++ b/scripts/qapi-visit.py @@ -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 |