Skip to content

Commit

Permalink
chore: use regular for loop for forkchoice prune
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths committed Aug 23, 2023
1 parent cac8bfa commit 5f5de5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/fork-choice/src/forkChoice/forkChoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,8 @@ export class ForkChoice implements IForkChoice {
prune(finalizedRoot: RootHex): ProtoBlock[] {
const prunedNodes = this.protoArray.maybePrune(finalizedRoot);
const prunedCount = prunedNodes.length;
for (const vote of this.votes) {
for (let i = 0; i < this.votes.length; i++) {
const vote = this.votes[i];
// validator has never voted
if (vote === undefined) {
continue;
Expand Down

0 comments on commit 5f5de5f

Please sign in to comment.