Use Byteorder or std instead of manual shifting
hellow554 opened this issue · 2 comments
hellow554 commented
zstd-rs/src/decoding/scratch.rs
Lines 74 to 77 in 1f6749d
There are numerous places like these, where you manually create a integer from bytes.
You should either use the Byteorder crate (which is already in the dependencies and rarely used) or use the std variants {from,to}_{le,be,ne}_bytes
.
KillingSpark commented
I'll look into the std lib's functions. I'd like to avoid the byteorder crate as much as possible to reduce the amount of unsafe code used. I juts pulled it in because it introduced a big performance boost
KillingSpark commented
I moved all of this into one module decoding::little_endian (which I should have done in the first place...)