ok/jj
1
0
Fork 0
forked from mirrors/jj

stacked_table: use u32::from_le_bytes() to reinterpret bytes as integer

Apparently, I forgot to update this in fb06e89649.
This commit is contained in:
Yuya Nishihara 2023-12-22 09:15:04 +09:00
parent 6f5096e266
commit 21c22be96e

View file

@ -182,9 +182,7 @@ impl<'table> ReadonlyTableIndexEntry<'table> {
}
fn value_offset(&self) -> usize {
(&self.data[self.data.len() - 4..self.data.len()])
.read_u32::<LittleEndian>()
.unwrap() as usize
u32::from_le_bytes(self.data[self.data.len() - 4..].try_into().unwrap()) as usize
}
}