Skip to content

Commit

Permalink
chore: use ?. syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
wemeetagain committed Jul 9, 2024
1 parent 2853822 commit 61c7a50
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/state-transition/src/cache/epochCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,9 @@ export class EpochCache {
// was already pulled by the api or another method on EpochCache
this.currentShuffling = this.nextShuffling;
} else {
this.currentShuffling = this.shufflingCache
? this.shufflingCache.getOrBuildSync(this.nextEpoch, this.nextDecisionRoot, state, this.nextActiveIndices)
: computeEpochShuffling(state, this.nextActiveIndices, this.nextEpoch);
this.currentShuffling =
this.shufflingCache?.getOrBuildSync(this.nextEpoch, this.nextDecisionRoot, state, this.nextActiveIndices) ??
computeEpochShuffling(state, this.nextActiveIndices, this.nextEpoch);
}

const currentEpoch = this.nextEpoch;
Expand Down Expand Up @@ -895,9 +895,8 @@ export class EpochCache {
return this.currentShuffling;
case this.nextEpoch:
if (!this.nextShuffling) {
this.nextShuffling = this.shufflingCache
? this.shufflingCache.getSync(this.nextEpoch, this.getDecisionRoot(this.nextEpoch))
: null;
this.nextShuffling =
this.shufflingCache?.getSync(this.nextEpoch, this.getDecisionRoot(this.nextEpoch)) ?? null;
}
return this.nextShuffling;
default:
Expand Down

0 comments on commit 61c7a50

Please sign in to comment.