Skip to content

Commit b04cde1

Browse files
committed
Abstract get_comp_item_ids.
Will be used elsewhere in subsequent commits.
1 parent c39c47c commit b04cde1

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/ir/context.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -971,17 +971,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
971971
fn deanonymize_fields(&mut self) {
972972
let _t = self.timer("deanonymize_fields");
973973

974-
let comp_item_ids: Vec<ItemId> = self
975-
.items()
976-
.filter_map(|(id, item)| {
977-
if item.kind().as_type()?.is_comp() {
978-
return Some(id);
979-
}
980-
None
981-
})
982-
.collect();
983-
984-
for id in comp_item_ids {
974+
for id in self.get_comp_item_ids() {
985975
self.with_loaned_item(id, |ctx, item| {
986976
item.kind_mut()
987977
.as_type_mut()
@@ -1165,6 +1155,17 @@ If you encounter an error missing from this list, please file an issue or a PR!"
11651155
(ret, self.options)
11661156
}
11671157

1158+
fn get_comp_item_ids(&self) -> Vec<ItemId> {
1159+
self.items()
1160+
.filter_map(|(id, item)| {
1161+
if item.kind().as_type()?.is_comp() {
1162+
return Some(id);
1163+
}
1164+
None
1165+
})
1166+
.collect()
1167+
}
1168+
11681169
/// When the `testing_only_extra_assertions` feature is enabled, this
11691170
/// function walks the IR graph and asserts that we do not have any edges
11701171
/// referencing an ItemId for which we do not have an associated IR item.

0 commit comments

Comments
 (0)