mesa: remove redundant modulus operation
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 23 May 2017 12:01:52 +0000 (22:01 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 25 May 2017 02:20:49 +0000 (12:20 +1000)
The if check above means we can only get here if size is less than 4.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/program/prog_parameter.c

index 44e680c048c31223da2df0dcde0e9456f3f78b16..40bc47de358e375324bc63ebee8ca85471cdf319 100644 (file)
@@ -267,9 +267,8 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList,
             COPY_4V(paramList->ParameterValues[oldNum + i], values);
          } else {
             /* copy 1, 2 or 3 values */
-            GLuint remaining = size % 4;
-            assert(remaining < 4);
-            for (j = 0; j < remaining; j++) {
+            assert(size < 4);
+            for (j = 0; j < size; j++) {
                paramList->ParameterValues[oldNum + i][j].f = values[j].f;
             }
             /* fill in remaining positions with zeros */