[Mesa-dev] [PATCH] mesa: simplify _mesa_IsVertexArray()

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Jun 20 13:13:15 UTC 2017


_mesa_lookup_vao() already returns NULL if id is zero.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/mesa/main/arrayobj.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 82c00fbe826..7988a225baf 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -605,14 +605,9 @@ _mesa_IsVertexArray( GLuint id )
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
 
-   if (id == 0)
-      return GL_FALSE;
-
    obj = _mesa_lookup_vao(ctx, id);
-   if (obj == NULL)
-      return GL_FALSE;
 
-   return obj->EverBound;
+   return obj ? obj->EverBound : GL_FALSE;
 }
 
 
-- 
2.13.1



More information about the mesa-dev mailing list