diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/typecheck/rust-tyty.cc | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc index 8202679..c16a804 100644 --- a/gcc/rust/typecheck/rust-tyty.cc +++ b/gcc/rust/typecheck/rust-tyty.cc @@ -347,25 +347,18 @@ bool TupleType::is_equal (const BaseType &other) const { if (get_kind () != other.get_kind ()) + return false; + + auto other2 = static_cast<const TupleType &> (other); + if (num_fields () != other2.num_fields ()) + return false; + + for (size_t i = 0; i < num_fields (); i++) { - return false; - } - else - { - auto other2 = static_cast<const TupleType &> (other); - if (num_fields () != other2.num_fields ()) - { - return false; - } - for (size_t i = 0; i < num_fields (); i++) - { - if (!get_field (i)->is_equal (*other2.get_field (i))) - { - return false; - } - } - return true; + if (!get_field (i)->is_equal (*other2.get_field (i))) + return false; } + return true; } BaseType * |