Mesa (master): mesa: simplify _mesa_IsVertexArray()
Samuel Pitoiset
hakzsam at kemper.freedesktop.org
Tue Jun 20 17:16:36 UTC 2017
Module: Mesa
Branch: master
Commit: 4f00b2bc7e4515257ff9c674259da1264ab2c9a3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4f00b2bc7e4515257ff9c674259da1264ab2c9a3
Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date: Tue Jun 20 15:13:15 2017 +0200
mesa: simplify _mesa_IsVertexArray()
_mesa_lookup_vao() already returns NULL if id is zero.
v2: - change the conditional (Ian)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com> (v1)
---
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 82c00fbe82..17a789f4da 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 != NULL && obj->EverBound;
}
More information about the mesa-commit
mailing list