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>
This commit is contained in:
parent
8c3f8e7721
commit
8c07eddc61
|
@ -16,14 +16,13 @@ from ordereddict import OrderedDict
|
||||||
from qapi import *
|
from qapi import *
|
||||||
import re
|
import re
|
||||||
|
|
||||||
implicit_structs = []
|
implicit_structs_seen = set()
|
||||||
struct_fields_seen = set()
|
struct_fields_seen = set()
|
||||||
|
|
||||||
def generate_visit_implicit_struct(type):
|
def generate_visit_implicit_struct(type):
|
||||||
global implicit_structs
|
if type in implicit_structs_seen:
|
||||||
if type in implicit_structs:
|
|
||||||
return ''
|
return ''
|
||||||
implicit_structs.append(type)
|
implicit_structs_seen.add(type)
|
||||||
ret = ''
|
ret = ''
|
||||||
if type not in struct_fields_seen:
|
if type not in struct_fields_seen:
|
||||||
# Need a forward declaration
|
# Need a forward declaration
|
||||||
|
|
Loading…
Reference in a new issue