linker: Slight code rearrange to prevent duplication in the next commit
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 7 Nov 2016 23:54:46 +0000 (15:54 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 9 Nov 2016 20:47:51 +0000 (12:47 -0800)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/compiler/glsl/link_uniforms.cpp

index 8e8d689..d3a77d5 100644 (file)
@@ -928,13 +928,12 @@ link_update_uniform_buffer_variables(struct gl_linked_shader *shader)
                if ((ptrdiff_t) l != (end - begin))
                   continue;
 
-               if (strncmp(var->name, begin, l) == 0) {
-                  found = true;
-                  var->data.location = j;
-                  break;
-               }
-            } else if (!strcmp(var->name, blks[i]->Uniforms[j].Name)) {
-               found = true;
+               found = strncmp(var->name, begin, l) == 0;
+            } else {
+               found = strcmp(var->name, blks[i]->Uniforms[j].Name) == 0;
+            }
+
+            if (found) {
                var->data.location = j;
                break;
             }