Skip to content

Commit

Permalink
remove slow .at(-1)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanruch committed Mar 28, 2024
1 parent 5cc5234 commit 7b15836
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions evm/evm-codec/src/sink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class Sink {
}

size() {
return this.stack.at(-1)!.size;
return this.stack[this.stack.length - 1].size;
}

private _allocate(cap: number): void {
Expand Down Expand Up @@ -193,11 +193,11 @@ export class Sink {
}

private start() {
return this.stack.at(-1)!.start;
return this.stack[this.stack.length - 1].start;
}

public increaseSize(amount: number) {
this.stack.at(-1)!.size += amount;
this.stack[this.stack.length - 1].size += amount;
}

private startDynamic(start: number, slotsCount: number) {
Expand Down

0 comments on commit 7b15836

Please sign in to comment.