Non-mutating find (no path compression). Borrow-safe.
(parent: &[usize], mut x: usize)
| 185 | |
| 186 | /// Non-mutating find (no path compression). Borrow-safe. |
| 187 | fn find_static(parent: &[usize], mut x: usize) -> usize { |
| 188 | while parent[x] != x { |
| 189 | x = parent[x]; |
| 190 | } |
| 191 | x |
| 192 | } |
| 193 | |
| 194 | #[cfg(test)] |
| 195 | mod tests { |
no outgoing calls
no test coverage detected