[vala/staging: 1/6] codegen: Drop superfluous dynamic-type cast



commit 7d01cf8e335fb2a5accdd3b69914a649803a80bc
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Oct 20 20:47:54 2016 +0200

    codegen: Drop superfluous dynamic-type cast

 codegen/valaccodebasemodule.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index dbacd3c..257ce71 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5353,7 +5353,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        make_comparable_cexpression (ref left_type, ref cleft, ref right_type, ref cright);
 
                        if (left_type is StructValueType && right_type is StructValueType) {
-                               var equalfunc = generate_struct_equal_function ((Struct) left_type.data_type 
as Struct);
+                               var equalfunc = generate_struct_equal_function ((Struct) left_type.data_type);
                                var ccall = new CCodeFunctionCall (new CCodeIdentifier (equalfunc));
                                ccall.add_argument (cleft);
                                ccall.add_argument (cright);
@@ -5489,7 +5489,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        ccall.add_argument (cneedle);
                        cif_condition = new CCodeBinaryExpression (CCodeBinaryOperator.EQUALITY, ccall, new 
CCodeConstant ("0"));
                } else if (array_type.element_type is StructValueType) {
-                       var equalfunc = generate_struct_equal_function ((Struct) 
array_type.element_type.data_type as Struct);
+                       var equalfunc = generate_struct_equal_function ((Struct) 
array_type.element_type.data_type);
                        var ccall = new CCodeFunctionCall (new CCodeIdentifier (equalfunc));
                        ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, 
celement));
                        ccall.add_argument (cneedle);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]