Skip to content

Remove Endian-Dependent Code Paths #26

Closed
@Alexhuszagh

Description

@Alexhuszagh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions