Skip to content

Commit

Permalink
Merge pull request #95 from nickbabcock/wasm-inline
Browse files Browse the repository at this point in the history
Always inline le64 for Wasm implementation
  • Loading branch information
nickbabcock authored Jan 9, 2025
2 parents 482d7cb + 10dd8d0 commit 967fc54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ impl WasmHash {
impl_write!(WasmHash);
impl_hasher!(WasmHash);

#[inline]
// This occassionally doesn't get inlined, which causes panic code to get emitted
#[inline(always)]
fn le_u64(x: &[u8]) -> u64 {
u64::from_le_bytes([x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]])
}
Expand Down

0 comments on commit 967fc54

Please sign in to comment.