[Mesa-dev] [PATCH 26/41] glapi: gl_XML.py: avoid unnecessary method call

Dylan Baker baker.dylan.c at gmail.com
Fri Apr 1 00:04:43 UTC 2016


Don't call and store a value that might not be used unless it's know
it's needed.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 src/mapi/glapi/gen/gl_XML.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
index 34f987e..a860b0d 100644
--- a/src/mapi/glapi/gen/gl_XML.py
+++ b/src/mapi/glapi/gen/gl_XML.py
@@ -243,13 +243,12 @@ class gl_print_base(object):
 
 
 def real_function_name(element):
-    name = element.get("name")
     alias = element.get("alias")
 
     if alias:
         return alias
     else:
-        return name
+        return element.get("name")
 
 
 def real_category_name(c):
-- 
2.8.0



More information about the mesa-dev mailing list