diff options
author | Eric Anholt <[email protected]> | 2017-09-08 15:30:00 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2017-09-26 14:50:29 -0700 |
commit | bb7c9789c2fbba0335993cb610cee3d455a8bedc (patch) | |
tree | 79733072bc937984b2a7efe2a4e7869a4b5774a4 /src/intel/genxml/gen_pack_header.py | |
parent | ef578906d849bf05d04d246e9e3994146dddc01d (diff) |
intel/genxml: Convert a not-present-or-"1" dict to a set.
I was implementing the same enum support in broadcom's gen_pack_header.py,
and did this same simplification there.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/genxml/gen_pack_header.py')
-rw-r--r-- | src/intel/genxml/gen_pack_header.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/intel/genxml/gen_pack_header.py b/src/intel/genxml/gen_pack_header.py index 9021f008a82..405f600174d 100644 --- a/src/intel/genxml/gen_pack_header.py +++ b/src/intel/genxml/gen_pack_header.py @@ -493,7 +493,8 @@ class Parser(object): self.instruction = None self.structs = {} - self.enums = {} + # Set of enum names we've seen. + self.enums = set() self.registers = {} def gen_prefix(self, name): @@ -540,7 +541,7 @@ class Parser(object): elif name == "enum": self.values = [] self.enum = safe_name(attrs["name"]) - self.enums[attrs["name"]] = 1 + self.enums.add(attrs["name"]) if "prefix" in attrs: self.prefix = safe_name(attrs["prefix"]) else: |