Skip to content

Commit 087b0fb

Browse files
committed
inline xxhash functions more?
1 parent 31141f2 commit 087b0fb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/common/xxhash.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const XXH_PRIME64_3: u64 = 0x165667b19e3779f9;
5151
const XXH_PRIME64_4: u64 = 0x85ebca77c2b2ae63;
5252
const XXH_PRIME64_5: u64 = 0x27d4eb2f165667c5;
5353

54+
#[inline(always)]
5455
const fn XXH64_round(acc: u64, input: u64) -> u64 {
5556
input
5657
.wrapping_mul(XXH_PRIME64_2)
@@ -59,12 +60,14 @@ const fn XXH64_round(acc: u64, input: u64) -> u64 {
5960
.wrapping_mul(XXH_PRIME64_1)
6061
}
6162

63+
#[inline(always)]
6264
const fn XXH64_mergeRound(acc: u64, val: u64) -> u64 {
6365
(acc ^ XXH64_round(0, val))
6466
.wrapping_mul(XXH_PRIME64_1)
6567
.wrapping_add(XXH_PRIME64_4)
6668
}
6769

70+
#[inline(always)]
6871
const fn XXH64_avalanche(mut hash: u64) -> u64 {
6972
hash ^= hash >> 33;
7073
hash = hash.wrapping_mul(XXH_PRIME64_2);

lib/decompress/zstd_decompress_block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,7 @@ fn ZSTD_updateFseStateWithDInfo(
15721572
nbBits: u32,
15731573
) {
15741574
let lowBits = bitD.read_bits(nbBits);
1575-
DStatePtr.state = (nextState as size_t).wrapping_add(lowBits as size_t);
1575+
DStatePtr.state = usize::from(nextState) + lowBits;
15761576
}
15771577

15781578
/// We need to add at most (ZSTD_WINDOWLOG_MAX_32 - 1) bits to read the maximum

0 commit comments

Comments
 (0)