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

Ian Romanick idr at freedesktop.org
Tue Apr 19 23:26:36 UTC 2016


On 03/31/2016 05:04 PM, Dylan Baker wrote:
> Don't call and store a value that might not be used unless it's know
                                                                  known

With that fixed, this patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> 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):
> 



More information about the mesa-dev mailing list