Skip to content

Commit

Permalink
Removed because unused
Browse files Browse the repository at this point in the history
  • Loading branch information
Eagle941 committed Sep 3, 2024
1 parent baf50b4 commit 6730792
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions crates/blockifier/src/state/visited_pcs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::collections::hash_map::{Entry, IntoIter, Iter};
use std::collections::hash_map::Entry;
use std::collections::{HashMap, HashSet};
use std::fmt::Debug;

Expand All @@ -20,7 +20,7 @@ where
///
/// The elements of the vector `pcs` match the type of field `pc` in
/// [`cairo_vm::vm::trace::trace_entry::RelocatedTraceEntry`]
fn insert(&mut self, class_hash: &ClassHash, pcs: &Vec<usize>);
fn insert(&mut self, class_hash: &ClassHash, pcs: &[usize]);

/// The function `extend` is used to extend an instance of `VisitedPcs` with another one.
fn extend(&mut self, class_hash: &ClassHash, pcs: &Self::T);
Expand All @@ -40,19 +40,14 @@ where

#[derive(Debug, Default, PartialEq, Eq)]
pub struct VisitedPcsSet(HashMap<ClassHash, HashSet<usize>>);
impl VisitedPcsSet {
pub fn iter(&self) -> impl Iterator<Item = (&ClassHash, &HashSet<usize>)> {
self.into_iter()
}
}
impl VisitedPcs for VisitedPcsSet {
type T = HashSet<usize>;

fn new() -> Self {
VisitedPcsSet(HashMap::default())
}

fn insert(&mut self, class_hash: &ClassHash, pcs: &Vec<usize>) {
fn insert(&mut self, class_hash: &ClassHash, pcs: &[usize]) {
self.0.entry(*class_hash).or_default().extend(pcs);
}

Expand All @@ -76,19 +71,3 @@ impl VisitedPcs for VisitedPcsSet {
pcs
}
}
impl IntoIterator for VisitedPcsSet {
type Item = (ClassHash, HashSet<usize>);
type IntoIter = IntoIter<ClassHash, HashSet<usize>>;

fn into_iter(self) -> IntoIter<ClassHash, HashSet<usize>> {
self.0.into_iter()
}
}
impl<'a> IntoIterator for &'a VisitedPcsSet {
type Item = (&'a ClassHash, &'a HashSet<usize>);
type IntoIter = Iter<'a, ClassHash, HashSet<usize>>;

fn into_iter(self) -> Iter<'a, ClassHash, HashSet<usize>> {
self.0.iter()
}
}

0 comments on commit 6730792

Please sign in to comment.