Use From in map_to_range
In an effort to remove unnecessary casts use `u128::from` to convert from `u64`s. Leave the cast to `u64` in there because it is right after a shift right and is brain-dead obvious.
This commit is contained in:
parent
d9331794f1
commit
342fe18ad0
|
@ -362,7 +362,7 @@ impl GcsFilterReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fast reduction of hash to [0, nm) range.
|
/// Fast reduction of hash to [0, nm) range.
|
||||||
fn map_to_range(hash: u64, nm: u64) -> u64 { ((hash as u128 * nm as u128) >> 64) as u64 }
|
fn map_to_range(hash: u64, nm: u64) -> u64 { ((u128::from(hash) * u128::from(nm)) >> 64) as u64 }
|
||||||
|
|
||||||
/// Golomb-Rice encoded filter writer.
|
/// Golomb-Rice encoded filter writer.
|
||||||
pub struct GcsFilterWriter<'a, W> {
|
pub struct GcsFilterWriter<'a, W> {
|
||||||
|
|
Loading…
Reference in New Issue