From 5bbb8254695b9f9da1f855ccf392c5ba3db9048d Mon Sep 17 00:00:00 2001 From: Jip Date: Sat, 13 Feb 2021 15:51:42 +0100 Subject: [PATCH] Do cheap check first --- backend/src/pokers/poker-room.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/pokers/poker-room.ts b/backend/src/pokers/poker-room.ts index 6325a65..860bda0 100644 --- a/backend/src/pokers/poker-room.ts +++ b/backend/src/pokers/poker-room.ts @@ -300,7 +300,7 @@ export class PokerRoom { * @returns {void} */ private changeVote( memberId: string, vote: VoteValue ): void { - if ( ! this.hasEverybodyVoted( this.currentStory ) ) { + if ( ! this.hasAllVotes( this.currentStory ) ) { this.getCurrentVote( memberId ).initialValue = vote; } if ( this.getCurrentVote( memberId ).initialValue === "coffee" ) { @@ -339,9 +339,10 @@ export class PokerRoom { * @returns {Vote[]} List of votes. */ public getCurrentVotes(): Vote[] { - if ( this.hasEverybodyVoted( this.currentStory ) || this.currentStory.votesRevealed ) { + if ( this.currentStory.votesRevealed || this.hasAllVotes( this.currentStory ) ) { return this.getUnobscuredVotes( this.currentStory ); } + return this.getObscuredVotes( this.currentStory ); }