From: Ian Romanick Date: Mon, 7 Nov 2016 23:54:46 +0000 (-0800) Subject: linker: Slight code rearrange to prevent duplication in the next commit X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=392fabcfee489c294dad5bed0bb57a2c61322e4d;p=mesa.git linker: Slight code rearrange to prevent duplication in the next commit Signed-off-by: Ian Romanick Reviewed-by: Kenneth Graunke Reviewed-by: Nicolai Hähnle --- diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp index 8e8d689dab1..d3a77d58c3b 100644 --- a/src/compiler/glsl/link_uniforms.cpp +++ b/src/compiler/glsl/link_uniforms.cpp @@ -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; }