Files
rust/compiler/rustc_data_structures
Josh Triplett 43ee7cd57c Simplify and optimize SlotIndex::from_index
Break out bucket 0 (containing `idx < 4096`) as an early return, which
simplifies the remainder of the function, and allows optimizing the
`checked_ilog2` since it can no longer return `None`.

This reduces the runtime of `vec_cache::tests::slot_index_exhaustive`
(which calls `SlotIndex::from_index` for every `u32`, twice) from ~15.5s
to ~13.3s.
2025-06-05 12:09:00 -07:00
..