Return the subset of `instances` that have `generic_id`. This is efficiently implemented via `BTreeMap::range`, taking advantage of the derived `Ord` on `Instance`, which orders by `generic_id` first, resulting in `instances` being grouped by `generic_id`.
(
&self,
generic_id: Word,
)
| 2248 | /// of the derived `Ord` on `Instance`, which orders by `generic_id` first, |
| 2249 | /// resulting in `instances` being grouped by `generic_id`. |
| 2250 | fn all_instances_of( |
| 2251 | &self, |
| 2252 | generic_id: Word, |
| 2253 | ) -> std::collections::btree_map::Range<'_, Instance<SmallVec<[CopyOperand; 4]>>, Word> { |
| 2254 | let first_instance_of = |generic_id| Instance { |
| 2255 | generic_id, |
| 2256 | generic_args: SmallVec::new(), |
| 2257 | }; |
| 2258 | self.instances |
| 2259 | .range(first_instance_of(generic_id)..first_instance_of(generic_id + 1)) |
| 2260 | } |
| 2261 | |
| 2262 | /// Allocate a new ID for `instance`, or return a cached one if it exists. |
| 2263 | /// If a new ID is created, `instance` is added to `propagate_instances_queue`, |
no outgoing calls
no test coverage detected