From 0b35f5f10dc9d773b6cdaf60a30ce3e76d39bb35 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Mon, 8 Mar 2021 15:52:22 +0000 Subject: Cleanup Formatting for is_equal on TupleTypes --- gcc/rust/typecheck/rust-tyty.cc | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'gcc') 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 (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 (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 * -- cgit v1.1