mesa: tidy up _mesa_DeleteVertexArrays()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 20 Jul 2017 09:52:58 +0000 (11:52 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 20 Jul 2017 14:14:24 +0000 (16:14 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/main/arrayobj.c

index 17a789f4da49c9979dd45912c8f16534a5126eb7..ce0050ace33ec86bafc2eb7ade22a5de0c09cc7a 100644 (file)
@@ -493,19 +493,18 @@ _mesa_DeleteVertexArrays(GLsizei n, const GLuint *ids)
    for (i = 0; i < n; i++) {
       struct gl_vertex_array_object *obj = _mesa_lookup_vao(ctx, ids[i]);
 
-      if ( obj != NULL ) {
-        assert( obj->Name == ids[i] );
-
-        /* If the array object is currently bound, the spec says "the binding
-         * for that object reverts to zero and the default vertex array
-         * becomes current."
-         */
-        if ( obj == ctx->Array.VAO ) {
-           _mesa_BindVertexArray(0);
-        }
-
-        /* The ID is immediately freed for re-use */
-        remove_array_object(ctx, obj);
+      if (obj) {
+         assert(obj->Name == ids[i]);
+
+         /* If the array object is currently bound, the spec says "the binding
+          * for that object reverts to zero and the default vertex array
+          * becomes current."
+          */
+         if (obj == ctx->Array.VAO)
+            _mesa_BindVertexArray(0);
+
+         /* The ID is immediately freed for re-use */
+         remove_array_object(ctx, obj);
 
          if (ctx->Array.LastLookedUpVAO == obj)
             _mesa_reference_vao(ctx, &ctx->Array.LastLookedUpVAO, NULL);