Skip to content

Commit

Permalink
chore: clippy, remove needless casts
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-da committed Apr 5, 2024
1 parent 18bddc7 commit 1c5e6c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/util_types/mutator_set/archival_mutator_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ where
let swbf_indices = get_swbf_indices(item, sender_randomness, receiver_preimage, aocl_index);

let batch_index = self.get_batch_index_async().await;
let window_start = batch_index as u128 * CHUNK_SIZE as u128;
let window_start = batch_index * CHUNK_SIZE as u128;

let chunk_indices: BTreeSet<u64> = swbf_indices
.iter()
Expand Down Expand Up @@ -270,7 +270,7 @@ where
pub async fn revert_remove(&mut self, removal_record: &RemovalRecord) {
let removal_record_indices: Vec<u128> = removal_record.absolute_indices.to_vec();
let batch_index = self.get_batch_index_async().await;
let active_window_start = batch_index as u128 * CHUNK_SIZE as u128;
let active_window_start = batch_index * CHUNK_SIZE as u128;
let mut chunkidx_to_difference_dict: HashMap<u64, Chunk> = HashMap::new();

// Populate the dictionary by iterating over all the removal
Expand Down Expand Up @@ -346,7 +346,7 @@ where
/// filter, whether in the active window, or in some chunk.
pub async fn bloom_filter_contains(&mut self, index: u128) -> bool {
let batch_index = self.get_batch_index_async().await;
let active_window_start = batch_index as u128 * CHUNK_SIZE as u128;
let active_window_start = batch_index * CHUNK_SIZE as u128;

if index >= active_window_start {
let relative_index = (index - active_window_start) as u32;
Expand Down Expand Up @@ -429,7 +429,7 @@ where
/// after applying the update. Does not mutate the removal record.
pub async fn remove_helper(&mut self, removal_record: &RemovalRecord) -> HashMap<u64, Chunk> {
let batch_index = self.get_batch_index_async().await;
let active_window_start = batch_index as u128 * CHUNK_SIZE as u128;
let active_window_start = batch_index * CHUNK_SIZE as u128;

// insert all indices
let mut new_target_chunks: ChunkDictionary = removal_record.target_chunks.clone();
Expand Down

0 comments on commit 1c5e6c9

Please sign in to comment.