Mesa (master): linker: Slight code rearrange to prevent duplication in the next commit

Ian Romanick idr at kemper.freedesktop.org
Wed Nov 9 21:22:20 UTC 2016


Module: Mesa
Branch: master
Commit: 392fabcfee489c294dad5bed0bb57a2c61322e4d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=392fabcfee489c294dad5bed0bb57a2c61322e4d

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Mon Nov  7 15:54:46 2016 -0800

linker: Slight code rearrange to prevent duplication in the next commit

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

---

 src/compiler/glsl/link_uniforms.cpp | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index 8e8d689..d3a77d5 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;
             }




More information about the mesa-commit mailing list