ir_constant_expression: Remove pointless use of variable_referenced.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 15 Jul 2010 17:27:53 +0000 (10:27 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 21 Jul 2010 00:10:05 +0000 (17:10 -0700)
ir_dereference_variable always references an ir_variable, so there's no
point in calling a function and NULL-checking the result.

src/glsl/ir_constant_expression.cpp

index 186d0c4..cb07f38 100644 (file)
@@ -695,10 +695,7 @@ ir_swizzle::constant_expression_value()
 ir_constant *
 ir_dereference_variable::constant_expression_value()
 {
-   ir_variable *var = this->variable_referenced();
-   if (var && var->constant_value)
-      return var->constant_value->clone(NULL);
-   return NULL;
+   return var->constant_value ? var->constant_value->clone(NULL) : NULL;
 }