mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 15:40:11 +01:00
intel/genxml: use a set for lookups
Python will pre-compute the set since it's const, and the performance of a set search is significantly better than that of a list search Reviewd-by: Jordan Justen <jordan.l.justen@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18917>
This commit is contained in:
parent
e04ece53d7
commit
f286451ada
1 changed files with 3 additions and 3 deletions
|
|
@ -21,19 +21,19 @@ def get_start(element):
|
|||
return int(element.attrib['start'], 0)
|
||||
|
||||
|
||||
base_types = [
|
||||
BASE_TYPES = {
|
||||
'address',
|
||||
'offset',
|
||||
'int',
|
||||
'uint',
|
||||
'bool',
|
||||
'float',
|
||||
]
|
||||
}
|
||||
|
||||
FIXED_PATTERN = re.compile(r"(s|u)(\d+)\.(\d+)")
|
||||
|
||||
def is_base_type(name):
|
||||
return name in base_types or FIXED_PATTERN.match(name)
|
||||
return name in BASE_TYPES or FIXED_PATTERN.match(name)
|
||||
|
||||
def add_struct_refs(items, node):
|
||||
if node.tag == 'field':
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue