Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hash-cache-tool: Use ahash::HashMap #2420

Merged
merged 1 commit into from
Aug 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions accounts-db/accounts-hash-cache-tool/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use {
ahash::{HashMap, RandomState},
bytemuck::Zeroable as _,
clap::{
crate_description, crate_name, value_t_or_exit, App, AppSettings, Arg, ArgMatches,
Expand All @@ -11,7 +12,6 @@ use {
},
std::{
cmp::Ordering,
collections::HashMap,
fs::{self, File, Metadata},
io::{self, BufReader, Read},
mem::size_of,
Expand Down Expand Up @@ -377,9 +377,9 @@ fn do_diff_dirs(
}

// if the binary data of the files are different, they are not equal
let ahash_random_state = ahash::RandomState::new();
let hash1 = ahash_random_state.hash_one(mmap1.as_ref());
let hash2 = ahash_random_state.hash_one(mmap2.as_ref());
let hasher = RandomState::new();
let hash1 = hasher.hash_one(mmap1.as_ref());
let hash2 = hasher.hash_one(mmap2.as_ref());
if hash1 != hash2 {
return false;
}
Expand Down