Mesa (master): glsl: Remove useless iteration through function parameters.

Kenneth Graunke kwg at kemper.freedesktop.org
Sun Dec 1 23:35:23 UTC 2013


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Nov 22 03:38:26 2013 -0800

glsl: Remove useless iteration through function parameters.

There's no need to loop through the "parameters" list and remove every
element; move_nodes_to(&parameters) already throws away all elements of
the destination list.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/glsl/ir.cpp |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index ffff297..3be7d51 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -1729,12 +1729,6 @@ ir_function_signature::replace_parameters(exec_list *new_params)
     * parameter information comes from the function prototype, it may either
     * specify incorrect parameter names or not have names at all.
     */
-   foreach_iter(exec_list_iterator, iter, parameters) {
-      assert(((ir_instruction *) iter.get())->as_variable() != NULL);
-
-      iter.remove();
-   }
-
    new_params->move_nodes_to(&parameters);
 }
 




More information about the mesa-commit mailing list