diff options
| author | mat <github@matdoes.dev> | 2022-08-24 21:09:17 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-08-24 21:09:17 -0500 |
| commit | 029ae0e567ccdc631a358755eba43b742811ff05 (patch) | |
| tree | a955489edeac1d303063b72392ecd644d070c57d /azalea-nbt/src/decode.rs | |
| parent | c64f10605bef9e5bf459b011b86ac6282b3d22e4 (diff) | |
| download | azalea-drasl-029ae0e567ccdc631a358755eba43b742811ff05.tar.xz | |
use unsigned integers for nbt lengths
probably not an optimization, just makes more sense
Diffstat (limited to 'azalea-nbt/src/decode.rs')
| -rwxr-xr-x | azalea-nbt/src/decode.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/azalea-nbt/src/decode.rs b/azalea-nbt/src/decode.rs index d4760807..2ab337fc 100755 --- a/azalea-nbt/src/decode.rs +++ b/azalea-nbt/src/decode.rs @@ -39,7 +39,7 @@ impl Tag { // A length-prefixed array of signed bytes. The prefix is a signed // integer (thus 4 bytes) 7 => { - let length = stream.read_i32::<BE>()?; + let length = stream.read_u32::<BE>()?; let mut bytes = vec![0; length as usize]; stream.read_exact(&mut bytes)?; Tag::ByteArray(bytes) @@ -84,7 +84,7 @@ impl Tag { // signed integer (thus 4 bytes) and indicates the number of 4 byte // integers. 11 => { - let length = stream.read_i32::<BE>()?; + let length = stream.read_u32::<BE>()?; let mut ints = Vec::with_capacity(length as usize); for _ in 0..length { ints.push(stream.read_i32::<BE>()?); @@ -94,7 +94,7 @@ impl Tag { // A length-prefixed array of signed longs. The prefix is a signed // integer (thus 4 bytes) and indicates the number of 8 byte longs. 12 => { - let length = stream.read_i32::<BE>()?; + let length = stream.read_u32::<BE>()?; let mut longs = Vec::with_capacity(length as usize); for _ in 0..length { longs.push(stream.read_i64::<BE>()?); |
