intel/genxml: use `a not in {x, y}` instead of `a != x or a != y`
authorDylan Baker <dylan.c.baker@intel.com>
Fri, 30 Sep 2022 18:29:30 +0000 (11:29 -0700)
committerDylan Baker <dylan.c.baker@intel.com>
Sat, 1 Oct 2022 21:03:49 +0000 (14:03 -0700)
It's faster, less code, and more idiomatic

Reviewd-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18917>

src/intel/genxml/gen_sort_tags.py

index 5473dfa..05ff67a 100755 (executable)
@@ -45,7 +45,7 @@ def add_struct_refs(items: typing.OrderedDict[str, bool], node: et.Element) -> N
             t = node.attrib['type']
             items[t] = True
         return
-    if node.tag != 'struct' and node.tag != 'group':
+    if node.tag not in {'struct', 'group'}:
         return
     for c in node:
         add_struct_refs(items, c)