Skip to content

Commit b43f76e

Browse files
committed
Inline NodeIndex methods.
Because they are small and hot.
1 parent 07b9d17 commit b43f76e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustc_data_structures/obligation_forest/node_index.rs

+2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ pub struct NodeIndex {
1717
}
1818

1919
impl NodeIndex {
20+
#[inline]
2021
pub fn new(value: usize) -> NodeIndex {
2122
assert!(value < (u32::MAX as usize));
2223
NodeIndex { index: NonZeroU32::new((value as u32) + 1).unwrap() }
2324
}
2425

26+
#[inline]
2527
pub fn get(self) -> usize {
2628
(self.index.get() - 1) as usize
2729
}

0 commit comments

Comments
 (0)