add thanks comment

This commit is contained in:
Folkert 2022-04-22 16:24:47 +02:00
parent 55749e7470
commit 6306923e0f
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -37,6 +37,14 @@ impl ReferenceMatrix {
}
}
// Topological sort and strongly-connected components
//
// Adapted from the Pathfinding crate v2.0.3 by Samuel Tardieu <sam@rfc1149.net>,
// licensed under the Apache License, version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
//
// The original source code can be found at: https://github.com/samueltardieu/pathfinding
//
// Thank you, Samuel!
impl ReferenceMatrix {
#[allow(clippy::type_complexity)]
pub fn topological_sort_into_groups(&self) -> Result<Vec<Vec<u32>>, (Vec<Vec<u32>>, Vec<u32>)> {
@ -76,11 +84,6 @@ impl ReferenceMatrix {
return Err((Vec::new(), remaining));
}
// NOTE: the original now removes elements from the preds_map if they have count 0
// for node in &prev_group {
// preds_map.remove(node);
// }
while preds_map.iter().any(|x| *x > 0) {
let mut next_group = Vec::<u32>::new();
for node in &prev_group {