This avoids recompiles of the re each time the function is called.
Signed-off-by: Dylan Baker <[email protected]>
---
src/mapi/glapi/gen/gl_XML.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
index a860b0d..73baef6 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
--
2.8.0
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev