Skip to content

Commit

Permalink
fix(round-robin): don't include bye player in results
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeromos Kovács committed Nov 25, 2024
1 parent 38990df commit 3c9dc4e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tournament/format/round_robin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ impl Format for RoundRobin {
fn results(self) -> Players {
// hashmap -> vec
let mut result: Vec<_> = self.points.into_iter().collect();
// don't include bye in results
if result.last().is_some_and(|p| p.0.is_unset()) {
result.pop();
}
// sorted by points
result.sort_by(|x, y| x.1.cmp(&y.1));
// extract players
Expand Down

0 comments on commit 3c9dc4e

Please sign in to comment.