Skip to content

Commit 5bbb825

Browse files
committed
Do cheap check first
1 parent 6a5f85b commit 5bbb825

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

backend/src/pokers/poker-room.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ export class PokerRoom {
300300
* @returns {void}
301301
*/
302302
private changeVote( memberId: string, vote: VoteValue ): void {
303-
if ( ! this.hasEverybodyVoted( this.currentStory ) ) {
303+
if ( ! this.hasAllVotes( this.currentStory ) ) {
304304
this.getCurrentVote( memberId ).initialValue = vote;
305305
}
306306
if ( this.getCurrentVote( memberId ).initialValue === "coffee" ) {
@@ -339,9 +339,10 @@ export class PokerRoom {
339339
* @returns {Vote[]} List of votes.
340340
*/
341341
public getCurrentVotes(): Vote[] {
342-
if ( this.hasEverybodyVoted( this.currentStory ) || this.currentStory.votesRevealed ) {
342+
if ( this.currentStory.votesRevealed || this.hasAllVotes( this.currentStory ) ) {
343343
return this.getUnobscuredVotes( this.currentStory );
344344
}
345+
345346
return this.getObscuredVotes( this.currentStory );
346347
}
347348

0 commit comments

Comments
 (0)