state-res: Refactor lexicographical_topological_sort
Gets rid of unnecessary copying and makes things more explicit by using a struct with named fields instead of a tuple for tie breaking. Co-authored-by: Jonathan de Jong <jonathan@automatia.nl>
This commit is contained in:
@@ -48,8 +48,8 @@ fn lexico_topo_sort(c: &mut Criterion) {
|
||||
event_id("p") => hashset![event_id("o")],
|
||||
};
|
||||
b.iter(|| {
|
||||
let _ = state_res::lexicographical_topological_sort(&graph, |id| {
|
||||
Ok((int!(0), MilliSecondsSinceUnixEpoch(uint!(0)), id.to_owned()))
|
||||
let _ = state_res::lexicographical_topological_sort(&graph, |_id| {
|
||||
Ok((int!(0), MilliSecondsSinceUnixEpoch(uint!(0))))
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user