aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2021-03-08 15:52:22 +0000
committerPhilip Herron <herron.philip@googlemail.com>2021-03-09 18:18:35 +0000
commit0b35f5f10dc9d773b6cdaf60a30ce3e76d39bb35 (patch)
treeeee1703d8e34f8e437a221277bcf18efa755dbc3 /gcc
parent6212572b23ccaaf355ab8376d3f5affec334b797 (diff)
downloadgcc-0b35f5f10dc9d773b6cdaf60a30ce3e76d39bb35.zip
gcc-0b35f5f10dc9d773b6cdaf60a30ce3e76d39bb35.tar.gz
gcc-0b35f5f10dc9d773b6cdaf60a30ce3e76d39bb35.tar.bz2
Cleanup Formatting for is_equal on TupleTypes
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/typecheck/rust-tyty.cc27
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 *