mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Reduce loop to while
This commit is contained in:
parent
32d4b45557
commit
8e093abaf5
1 changed files with 4 additions and 7 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue