Skip to content

Commit

Permalink
chore: use ?? instead of ||
Browse files Browse the repository at this point in the history
  • Loading branch information
samlior authored Jul 8, 2021
1 parent a3f2769 commit 87e13d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/service/addrVotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class AddrVotes {
tiebreaker = new Multiaddr(Object.keys(this.tallies)[0]);
}
const tiebreakerStr = tiebreaker.toString();
let best: [string, number] = [tiebreakerStr, this.tallies[tiebreakerStr] || 0];
let best: [string, number] = [tiebreakerStr, this.tallies[tiebreakerStr] ?? 0];
for (const [addrStr, total] of Object.entries(this.tallies)) {
if (total > best[1]) {
best = [addrStr, total];
Expand Down

0 comments on commit 87e13d1

Please sign in to comment.