From 7b15836e754c9a604081e54cbe61ea0e45f0264b Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 28 Mar 2024 13:30:14 +0100 Subject: [PATCH] remove slow .at(-1) --- evm/evm-codec/src/sink.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evm/evm-codec/src/sink.ts b/evm/evm-codec/src/sink.ts index c71f0823a..783f45543 100644 --- a/evm/evm-codec/src/sink.ts +++ b/evm/evm-codec/src/sink.ts @@ -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 { @@ -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) {