From 585e44933cea84365e4fbfb8b509c36b78e476fe Mon Sep 17 00:00:00 2001 From: HaoranYi Date: Tue, 26 Sep 2023 21:33:21 +0000 Subject: [PATCH] clean up --- accounts-db/src/accounts_hash.rs | 4 ++-- bucket_map/src/bucket.rs | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/accounts-db/src/accounts_hash.rs b/accounts-db/src/accounts_hash.rs index 77bdc31601f625..74d1cfa8a1681a 100644 --- a/accounts-db/src/accounts_hash.rs +++ b/accounts-db/src/accounts_hash.rs @@ -542,7 +542,7 @@ impl<'a> AccountsHasher<'a> { // This function is designed to allow hashes to be located in multiple, perhaps multiply deep vecs. // The caller provides a function to return a slice from the source data. - pub fn compute_merkle_root_from_slices<'b, F, T>( + fn compute_merkle_root_from_slices<'b, F, T>( total_hashes: usize, fanout: usize, max_levels_per_pass: Option, @@ -706,7 +706,7 @@ impl<'a> AccountsHasher<'a> { } } - pub fn compute_merkle_root_from_slices_recurse( + fn compute_merkle_root_from_slices_recurse( hashes: Vec, fanout: usize, max_levels_per_pass: Option, diff --git a/bucket_map/src/bucket.rs b/bucket_map/src/bucket.rs index 1eb9ae18b60850..036743c214dc46 100644 --- a/bucket_map/src/bucket.rs +++ b/bucket_map/src/bucket.rs @@ -476,10 +476,9 @@ impl<'b, T: Clone + Copy + PartialEq + std::fmt::Debug + 'static> Bucket { // pop one entry at a time to insert in the first free location we find 'outer: while let Some((ix_entry_raw, i)) = reverse_sorted_entries.pop() { let (k, v) = &items[i]; - let ix_entry = ix_entry_raw % cap; // search for an empty spot starting at `ix_entry` for search in 0..search_end { - let ix_index = (ix_entry + search) % cap; + let ix_index = (ix_entry_raw + search) % cap; let elem = IndexEntryPlaceInBucket::new(ix_index); if index.try_lock(ix_index) { *entries_created_on_disk += 1;