Skip to content

Commit 2f4b40f

Browse files
committed
Do not render both cached and uncached edge between two steps
1 parent 450040f commit 2f4b40f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/bootstrap/src/utils/step_graph.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,12 @@ struct Node {
100100
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
101101
struct NodeHandle(usize);
102102

103+
/// Represents a dependency between two bootstrap steps.
103104
#[derive(PartialEq, Eq, Hash, PartialOrd, Ord)]
104105
struct Edge {
105106
src: NodeHandle,
106107
dst: NodeHandle,
108+
// Was the corresponding execution of a step cached, or was the step actually executed?
107109
cached: bool,
108110
}
109111

@@ -134,7 +136,11 @@ impl DotGraph {
134136
}
135137

136138
fn add_cached_edge(&mut self, src: NodeHandle, dst: NodeHandle) {
137-
self.edges.insert(Edge { src, dst, cached: true });
139+
// There's no point in rendering both cached and uncached edge
140+
let uncached = Edge { src, dst, cached: false };
141+
if !self.edges.contains(&uncached) {
142+
self.edges.insert(Edge { src, dst, cached: true });
143+
}
138144
}
139145

140146
fn get_handle_by_key(&self, key: &str) -> Option<NodeHandle> {

0 commit comments

Comments
 (0)