Recursively count conflicts in a path.
(path: &ConflictPath)
| 261 | |
| 262 | /// Recursively count conflicts in a path. |
| 263 | fn count_conflicts_in_path(path: &ConflictPath) -> usize { |
| 264 | let mut count = 0; |
| 265 | for element in &path.elements { |
| 266 | match element { |
| 267 | PathElement::Scc { .. } => {} |
| 268 | PathElement::Conflict { sides } => { |
| 269 | count += 1; // This conflict itself |
| 270 | for side in sides { |
| 271 | count += count_conflicts_in_path(side); |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | } |
| 276 | count |
| 277 | } |
| 278 | |
| 279 | // ORDER RESULT |
| 280 |