aldanor/fast-float-rust

Remove Endian-Dependent Code Paths

Alexhuszagh opened this issue · 0 comments

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 and write_u64 to use u64::from_le and u64::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.