Skip to content

Commit

Permalink
hash-cache-tool: Use ahash::HashMap (anza-xyz#2420)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored and ray-kast committed Nov 27, 2024
1 parent ca357a0 commit 02324f9
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 02324f9

Please sign in to comment.