Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit edff309

Browse files
author
Hendrik van Antwerpen
committed
Rename CycleDetector to SimilarPathDetector
1 parent 9a475b8 commit edff309

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

stack-graphs/src/cycles.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ use crate::paths::Path;
4545
use crate::stitching::Database;
4646
use crate::stitching::OwnedOrDatabasePath;
4747

48-
/// Helps detect cycles in the path-finding algorithm.
49-
pub struct CycleDetector<P> {
48+
/// Helps detect similar paths in the path-finding algorithm.
49+
pub struct SimilarPathDetector<P> {
5050
paths: HashMap<PathKey, SmallVec<[P; 8]>>,
5151
}
5252

@@ -93,13 +93,13 @@ impl HasPathKey for PartialPath {
9393

9494
const MAX_SIMILAR_PATH_COUNT: usize = 7;
9595

96-
impl<P> CycleDetector<P>
96+
impl<P> SimilarPathDetector<P>
9797
where
9898
P: HasPathKey,
9999
{
100100
/// Creates a new, empty cycle detector.
101-
pub fn new() -> CycleDetector<P> {
102-
CycleDetector {
101+
pub fn new() -> SimilarPathDetector<P> {
102+
SimilarPathDetector {
103103
paths: HashMap::new(),
104104
}
105105
}

stack-graphs/src/partial.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ use smallvec::SmallVec;
4545
use crate::arena::Deque;
4646
use crate::arena::DequeArena;
4747
use crate::arena::Handle;
48-
use crate::cycles::CycleDetector;
4948
use crate::cycles::EdgeAppendingCycleDetector;
49+
use crate::cycles::SimilarPathDetector;
5050
use crate::graph::Edge;
5151
use crate::graph::File;
5252
use crate::graph::Node;
@@ -2696,7 +2696,7 @@ impl PartialPaths {
26962696
}
26972697

26982698
copious_debugging!("Find all partial paths in {}", graph[file]);
2699-
let mut similar_path_detector = CycleDetector::new();
2699+
let mut similar_path_detector = SimilarPathDetector::new();
27002700
let mut queue = VecDeque::new();
27012701
queue.extend(
27022702
graph

stack-graphs/src/paths.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::arena::DequeArena;
2626
use crate::arena::Handle;
2727
use crate::arena::List;
2828
use crate::arena::ListArena;
29-
use crate::cycles::CycleDetector;
29+
use crate::cycles::SimilarPathDetector;
3030
use crate::graph::Edge;
3131
use crate::graph::Node;
3232
use crate::graph::NodeID;
@@ -901,7 +901,7 @@ impl Paths {
901901
I: IntoIterator<Item = Handle<Node>>,
902902
F: FnMut(&StackGraph, &mut Paths, Path),
903903
{
904-
let mut cycle_detector = CycleDetector::new();
904+
let mut cycle_detector = SimilarPathDetector::new();
905905
let mut queue = starting_nodes
906906
.into_iter()
907907
.filter_map(|node| Path::from_node(graph, self, node))

stack-graphs/src/stitching.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ use crate::arena::List;
4848
use crate::arena::ListArena;
4949
use crate::arena::ListCell;
5050
use crate::arena::SupplementalArena;
51-
use crate::cycles::CycleDetector;
5251
use crate::cycles::PartialPathAppendingCycleDetector;
52+
use crate::cycles::SimilarPathDetector;
5353
use crate::graph::Node;
5454
use crate::graph::StackGraph;
5555
use crate::graph::Symbol;
@@ -477,7 +477,7 @@ pub struct PathStitcher {
477477
candidate_paths: Vec<Handle<PartialPath>>,
478478
queue: VecDeque<Path>,
479479
next_iteration: VecDeque<Path>,
480-
cycle_detector: CycleDetector<Path>,
480+
cycle_detector: SimilarPathDetector<Path>,
481481
max_work_per_phase: usize,
482482
#[cfg(feature = "copious-debugging")]
483483
phase_number: usize,
@@ -522,7 +522,7 @@ impl PathStitcher {
522522
candidate_paths,
523523
queue: VecDeque::new(),
524524
next_iteration,
525-
cycle_detector: CycleDetector::new(),
525+
cycle_detector: SimilarPathDetector::new(),
526526
// By default, there's no artificial bound on the amount of work done per phase
527527
max_work_per_phase: usize::MAX,
528528
#[cfg(feature = "copious-debugging")]
@@ -725,7 +725,7 @@ pub struct ForwardPartialPathStitcher {
725725
VecDeque<PartialPath>,
726726
VecDeque<PartialPathAppendingCycleDetector>,
727727
),
728-
similar_path_detector: CycleDetector<PartialPath>,
728+
similar_path_detector: SimilarPathDetector<PartialPath>,
729729
max_work_per_phase: usize,
730730
#[cfg(feature = "copious-debugging")]
731731
phase_number: usize,
@@ -794,7 +794,7 @@ impl ForwardPartialPathStitcher {
794794
candidate_partial_paths,
795795
queue: VecDeque::new(),
796796
next_iteration,
797-
similar_path_detector: CycleDetector::new(),
797+
similar_path_detector: SimilarPathDetector::new(),
798798
// By default, there's no artificial bound on the amount of work done per phase
799799
max_work_per_phase: usize::MAX,
800800
#[cfg(feature = "copious-debugging")]
@@ -834,7 +834,7 @@ impl ForwardPartialPathStitcher {
834834
candidate_partial_paths: Vec::new(),
835835
queue: VecDeque::new(),
836836
next_iteration,
837-
similar_path_detector: CycleDetector::new(),
837+
similar_path_detector: SimilarPathDetector::new(),
838838
// By default, there's no artificial bound on the amount of work done per phase
839839
max_work_per_phase: usize::MAX,
840840
#[cfg(feature = "copious-debugging")]

0 commit comments

Comments
 (0)