anv/cmd_buffer: Simplify range member assignment
authorNanley Chery <nanley.g.chery@intel.com>
Tue, 12 Jul 2016 15:10:18 +0000 (08:10 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Fri, 15 Jul 2016 17:35:40 +0000 (10:35 -0700)
A ternary is clearer because the range member is assigned one of two values
dependant on one condition.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_cmd_buffer.c

index 9ceb194425c0d1d66920b0bdec38e10f1a9092f3..6256df8bd7217907978109c5dc09d28fb06348f8 100644 (file)
@@ -646,11 +646,9 @@ void anv_CmdBindDescriptorSets(
 
                unsigned array_size = set_layout->binding[b].array_size;
                for (unsigned j = 0; j < array_size; j++) {
-                  uint32_t range = 0;
-                  if (desc->buffer_view)
-                     range = desc->buffer_view->range;
                   push->dynamic[d].offset = *(offsets++);
-                  push->dynamic[d].range = range;
+                  push->dynamic[d].range = (desc->buffer_view) ?
+                                            desc->buffer_view->range : 0;
                   desc++;
                   d++;
                }