mesa: Remove deleteFlag pattern from container objects.
authorMatt Turner <mattst88@gmail.com>
Wed, 5 Apr 2017 04:29:00 +0000 (14:29 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sat, 22 Apr 2017 00:01:15 +0000 (10:01 +1000)
This pattern was only useful when we used mutex locks, which the previous
commit removed.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/mesa/main/arrayobj.c
src/mesa/main/pipelineobj.c

index 9f4477e45b32d7bf17ad9d9787c103b757c5accc..24555d9c7a60d33e5ce3cdaff3a0539d20d1cff1 100644 (file)
@@ -188,14 +188,12 @@ _mesa_reference_vao_(struct gl_context *ctx,
 
    if (*ptr) {
       /* Unreference the old array object */
-      GLboolean deleteFlag = GL_FALSE;
       struct gl_vertex_array_object *oldObj = *ptr;
 
       assert(oldObj->RefCount > 0);
       oldObj->RefCount--;
-      deleteFlag = (oldObj->RefCount == 0);
 
-      if (deleteFlag)
+      if (oldObj->RefCount == 0)
          _mesa_delete_vao(ctx, oldObj);
 
       *ptr = NULL;
index a0fa55a85c445f9d3e26e311aae857458b3d0620..9a852be09204fd93c8a15f273183661dc5d5692a 100644 (file)
@@ -184,14 +184,12 @@ _mesa_reference_pipeline_object_(struct gl_context *ctx,
 
    if (*ptr) {
       /* Unreference the old pipeline object */
-      GLboolean deleteFlag = GL_FALSE;
       struct gl_pipeline_object *oldObj = *ptr;
 
       assert(oldObj->RefCount > 0);
       oldObj->RefCount--;
-      deleteFlag = (oldObj->RefCount == 0);
 
-      if (deleteFlag) {
+      if (oldObj->RefCount == 0) {
          _mesa_delete_pipeline_object(ctx, oldObj);
       }