Skip to content

Commit 9dd7930

Browse files
authored
fix: fix NaN computation on ranked choice (#1173)
chore: delete typo
1 parent 819c308 commit 9dd7930

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/voting/rankedChoice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export default class RankedChoiceVoting {
143143
this.strategies.map((strategy, sI) => {
144144
return finalRound
145145
.filter((res) => Number(res[0]) === i + 1)
146-
.reduce((a, b) => a + b[1][1][sI], 0);
146+
.reduce((a, b) => a + b[1][1][sI] || 0, 0);
147147
})
148148
);
149149
}

0 commit comments

Comments
 (0)