we already know that everyone doesn't have the...
same score so we can stop iterating.
This commit is contained in:
parent
b955d19811
commit
1dc1742fa0
1 changed files with 4 additions and 1 deletions
|
@ -17,7 +17,10 @@ module.exports = class {
|
|||
|
||||
let everyoneHasTheSameScore = true;
|
||||
for (let i = 0; i < playerScores.length; i++) {
|
||||
if (playerScores[i].score != lowestScore) everyoneHasTheSameScore = false;
|
||||
if (playerScores[i].score != lowestScore) {
|
||||
everyoneHasTheSameScore = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Everyone has the same score, we don't need to kick anyone
|
||||
|
|
Loading…
Reference in a new issue