File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -217,16 +217,16 @@ impl IndexMut<usize> for PageTable {
217
217
impl Index < PageTableIndex > for PageTable {
218
218
type Output = PageTableEntry ;
219
219
220
+ #[ inline]
220
221
fn index ( & self , index : PageTableIndex ) -> & Self :: Output {
221
- // Safety: A PageTableIndex never contains a value >= 512.
222
- unsafe { self . entries . get_unchecked ( usize:: from ( index) ) }
222
+ & self . entries [ usize:: from ( index) ]
223
223
}
224
224
}
225
225
226
226
impl IndexMut < PageTableIndex > for PageTable {
227
+ #[ inline]
227
228
fn index_mut ( & mut self , index : PageTableIndex ) -> & mut Self :: Output {
228
- // Safety: A PageTableIndex never contains a value >= 512.
229
- unsafe { self . entries . get_unchecked_mut ( usize:: from ( index) ) }
229
+ & mut self . entries [ usize:: from ( index) ]
230
230
}
231
231
}
232
232
You can’t perform that action at this time.
0 commit comments