This patch is Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>
On 03/31/2016 05:04 PM, Dylan Baker wrote: > This avoids recompiles of the re each time the function is called. > > Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com> > --- > 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 > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev