gallium/u_inlines: remove the destroy variable in pipe_reference_described
authorMarek Olšák <marek.olsak@amd.com>
Sat, 1 Sep 2018 05:28:08 +0000 (01:28 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 10 Sep 2018 18:53:01 +0000 (14:53 -0400)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
src/gallium/auxiliary/util/u_inlines.h

index 820d3080a5cb2548f4daeb18fc5127f23e9b33c5..b06fb111709f20535af53c11bda24d9080522a0e 100644 (file)
@@ -74,8 +74,6 @@ pipe_reference_described(struct pipe_reference *dst,
                          struct pipe_reference *src,
                          debug_reference_descriptor get_desc)
 {
-   boolean destroy = FALSE;
-
    if (dst != src) {
       /* bump the src.count first */
       if (src) {
@@ -87,14 +85,13 @@ pipe_reference_described(struct pipe_reference *dst,
       if (dst) {
          int count = p_atomic_dec_return(&dst->count);
          assert(count != -1); /* dst had to be referenced */
-         if (!count)
-            destroy = TRUE;
-
          debug_reference(dst, get_desc, -1);
+         if (!count)
+            return true;
       }
    }
 
-   return destroy;
+   return false;
 }
 
 static inline boolean