From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAOWq-0003Mg-Oo for qemu-devel@nongnu.org; Wed, 01 Jul 2015 16:22:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAOWn-00061O-H2 for qemu-devel@nongnu.org; Wed, 01 Jul 2015 16:22:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAOWn-00060y-CV for qemu-devel@nongnu.org; Wed, 01 Jul 2015 16:22:41 -0400 From: Markus Armbruster Date: Wed, 1 Jul 2015 22:21:57 +0200 Message-Id: <1435782155-31412-10-git-send-email-armbru@redhat.com> In-Reply-To: <1435782155-31412-1-git-send-email-armbru@redhat.com> References: <1435782155-31412-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH RFC v2 09/47] qapi-visit: Replace list implicit_structs by set List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, berto@igalia.com, mdroth@linux.vnet.ibm.com Use set because that's what it is. While there, rename to implicit_structs_seen. Signed-off-by: Markus Armbruster --- scripts/qapi-visit.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py index b3a308f..9fc040e 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 -- 1.9.3