Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Sep 19, 2024
1 parent b695a59 commit 65732ee
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/red_knot_python_semantic/src/types/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,18 @@ impl<'db> UnionBuilder<'db> {
}
Type::Never => {}
_ => {
let mut add = true;
let mut remove = vec![];
for element in &self.elements {
if ty.is_subtype_of(self.db, *element) {
add = false;
return self;
} else if element.is_subtype_of(self.db, ty) {
remove.push(*element);
}
}
for element in remove {
self.elements.remove(&element);
}
if add {
self.elements.insert(ty);
}
self.elements.insert(ty);
}
}

Expand Down

0 comments on commit 65732ee

Please sign in to comment.