1
0
Fork 0
mirror of https://github.com/azalea-rs/simdnbt.git synced 2025-08-02 07:26:04 +00:00

inline read_with_type for 12% speedup

This commit is contained in:
mat 2024-05-13 05:34:55 +00:00
parent 2a9a1ca8d7
commit 5cf042edb4

View file

@ -226,6 +226,7 @@ impl NbtTag {
unsafe { *<*const _>::from(self).cast::<u8>() }
}
#[inline(always)]
fn read_with_type(data: &mut Cursor<&[u8]>, tag_type: u8, depth: usize) -> Result<Self, Error> {
match tag_type {
BYTE_ID => Ok(NbtTag::Byte(