diff options
-rw-r--r-- | crates/ra_db/src/input.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs index e9a991a57..f445e03bc 100644 --- a/crates/ra_db/src/input.rs +++ b/crates/ra_db/src/input.rs | |||
@@ -118,9 +118,10 @@ impl CrateGraph { | |||
118 | self.arena[&crate_id].dependencies.iter() | 118 | self.arena[&crate_id].dependencies.iter() |
119 | } | 119 | } |
120 | fn dfs_find(&self, target: CrateId, from: CrateId, visited: &mut FxHashSet<CrateId>) -> bool { | 120 | fn dfs_find(&self, target: CrateId, from: CrateId, visited: &mut FxHashSet<CrateId>) -> bool { |
121 | if visited.contains(&from) { | 121 | if !visited.insert(from) { |
122 | return false; | 122 | return false; |
123 | } | 123 | } |
124 | |||
124 | for dep in self.dependencies(from) { | 125 | for dep in self.dependencies(from) { |
125 | let crate_id = dep.crate_id(); | 126 | let crate_id = dep.crate_id(); |
126 | if crate_id == target { | 127 | if crate_id == target { |
@@ -131,7 +132,6 @@ impl CrateGraph { | |||
131 | return true; | 132 | return true; |
132 | } | 133 | } |
133 | } | 134 | } |
134 | visited.insert(from); | ||
135 | return false; | 135 | return false; |
136 | } | 136 | } |
137 | } | 137 | } |