diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2016-03-29 16:13:49 -0700 |
---|---|---|
committer | Dylan Baker <baker.dylan.c@gmail.com> | 2016-03-31 16:03:58 -0700 |
commit | 8ddcec2058ed6379f1f5d3550a9299805f525ff7 (patch) | |
tree | 1b04678126bf4a45d5b99230fd2f80a11d045eb5 | |
parent | 424d733edad74a33986130f7f9cd32251ff8f8b0 (diff) |
glapi: gl_XML.py: store compiled re as a module variable
This avoids recompiles of the re each time the function is called.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
-rw-r--r-- | src/mapi/glapi/gen/gl_XML.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py index a860b0d84f..73baef6598 100644 --- a/src/mapi/glapi/gen/gl_XML.py +++ b/src/mapi/glapi/gen/gl_XML.py @@ -38,6 +38,8 @@ import xml.etree.ElementTree as ET import static_data import typeexpr +_REAL_CATEGORY_FINDER = re.compile("[1-9][0-9]*[.][0-9]+") + def parse_GL_API(file_name, factory=None): @@ -252,7 +254,7 @@ def real_function_name(element): def real_category_name(c): - if re.compile("[1-9][0-9]*[.][0-9]+").match(c): + if _REAL_CATEGORY_FINDER.match(c): return "GL_VERSION_" + c.replace(".", "_") else: return c |