Reduce loop to while

This commit is contained in:
Ayaz Hafiz 2023-04-10 16:36:18 -05:00
parent 32d4b45557
commit 8e093abaf5
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -1338,13 +1338,10 @@ impl Types {
pub fn shallow_dealias(&self, value: Index<TypeTag>) -> Index<TypeTag> {
let mut result = value;
loop {
match self[result] {
TypeTag::StructuralAlias { actual, .. } | TypeTag::OpaqueAlias { actual, .. } => {
result = actual
}
_ => break,
}
while let TypeTag::StructuralAlias { actual, .. } | TypeTag::OpaqueAlias { actual, .. } =
self[result]
{
result = actual;
}
result
}