Remove Endian-Dependent Code Paths
Alexhuszagh opened this issue · 0 comments
Alexhuszagh commented
Issue
Currently, read_u64
is only used on little-endian architectures, providing optimizations only for little-endian systems. Since this is an important optimization during parsing, it should be important to ensure this works on all architecture byte-orders, big and little.
Fix
- Change
read_u64
andwrite_u64
to useu64::from_le
andu64::to_le
, respectively. - Remove all
cfg_if!(target_endian = "little")
conditions. - Test to ensure a the number is read and written as little-endian bytes.
- Rename functions annotated with
le
.