fix potential crash bug
This commit is contained in:
parent
40793af5c3
commit
731fa91b72
1 changed files with 3 additions and 1 deletions
|
|
@ -657,7 +657,9 @@ impl Ranking for User {
|
|||
let mut wins = vec![0u32, 0u32];
|
||||
for r in &results {
|
||||
let won_team = r.team_id ^ (!r.team_win);
|
||||
wins[won_team as usize] += 1;
|
||||
if let Some(team) = wins.get_mut(won_team as usize) {
|
||||
*team += 1
|
||||
};
|
||||
}
|
||||
|
||||
let score_data: Vec<CompetitionRankingScoreData> = results
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue