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

Commit 7ae64b2

Browse files
author
Hendrik van Antwerpen
committed
Make new path finding the default, use feature flag for old algorithm
1 parent ba6e68c commit 7ae64b2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

stack-graphs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ edition = "2018"
1515
[features]
1616
copious-debugging = []
1717
json = ["serde", "serde_json"]
18-
new-partial-paths = []
18+
partial-path-finding-v1 = []
1919

2020
[lib]
2121
# All of our tests are in the tests/it "integration" test executable.

stack-graphs/src/partial.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2065,15 +2065,15 @@ impl PartialPath {
20652065
node.is_endpoint() || node.is_jump_to()
20662066
}
20672067

2068-
#[cfg(feature = "new-partial-paths")]
2068+
#[cfg(not(feature = "partial-path-finding-v1"))]
20692069
pub fn as_complete_as_necessary(&self, graph: &StackGraph) -> bool {
20702070
self.starts_at_endpoint(graph) && self.ends_at_endpoint(graph)
20712071
}
20722072

20732073
/// A partial path is _as complete as possible_ if we cannot extend it any further within the
20742074
/// current file. This represents the maximal amount of work that we can pre-compute at index
20752075
/// time.
2076-
#[cfg(not(feature = "new-partial-paths"))]
2076+
#[cfg(feature = "partial-path-finding-v1")]
20772077
pub fn is_complete_as_possible(&self, graph: &StackGraph) -> bool {
20782078
match &graph[self.start_node] {
20792079
Node::Root(_) => (),
@@ -2505,7 +2505,7 @@ impl Node {
25052505
}
25062506
}
25072507

2508-
#[cfg(not(feature = "new-partial-paths"))]
2508+
#[cfg(feature = "partial-path-finding-v1")]
25092509
impl PartialPaths {
25102510
/// Finds all partial paths in a file, calling the `visit` closure for each one.
25112511
///
@@ -2563,7 +2563,7 @@ impl PartialPaths {
25632563
}
25642564
}
25652565

2566-
#[cfg(feature = "new-partial-paths")]
2566+
#[cfg(not(feature = "partial-path-finding-v1"))]
25672567
impl PartialPaths {
25682568
/// Finds all partial paths in a file, calling the `visit` closure for each one.
25692569
///

0 commit comments

Comments
 (0)