From c44a913c2d28c9258523d4ee3bb742827f69d561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Tue, 18 Aug 2026 23:50:15 +0200 Subject: [PATCH] faster extended resetting in loadCell --- src/common/buffer/BufferLine.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/buffer/BufferLine.ts b/src/common/buffer/BufferLine.ts index f7fbdb613..c84857113 100644 --- a/src/common/buffer/BufferLine.ts +++ b/src/common/buffer/BufferLine.ts @@ -41,6 +41,7 @@ export const DEFAULT_ATTR_DATA = Object.freeze(new AttributeData()); // Work variables to avoid garbage collection let $startIndex = 0; const $workCell = new CellData(); +const $extended = DEFAULT_ATTR_DATA.extended.clone(); /** @@ -205,7 +206,11 @@ export class BufferLine implements IBufferLine { } else { // Do not mutate cell.extended in place: it may still reference this line's map entry from a // prior loadCell into a reused CellData (e.g. $workCell during insert/delete). - cell.extended = DEFAULT_ATTR_DATA.extended.clone(); + // We use $extended as blueprint and reset the internals + // mimicking the ctor to avoid a new allocation. + cell.extended = $extended; + (cell.extended as any)._ext = 0; + (cell.extended as any)._urlId = 0; } return cell; }