mesa: simplify _mesa_IsVertexArray()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 20 Jun 2017 13:13:15 +0000 (15:13 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 20 Jun 2017 17:15:17 +0000 (19:15 +0200)
_mesa_lookup_vao() already returns NULL if id is zero.

v2: - change the conditional (Ian)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com> (v1)
src/mesa/main/arrayobj.c

index 82c00fb..17a789f 100644 (file)
@@ -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 != NULL && obj->EverBound;
 }