Cache work cell in hot loops

This commit is contained in:
Daniel Imms
2026-01-31 10:26:15 -08:00
parent 8eed7b4163
commit 3ef43aedb1
2 changed files with 6 additions and 5 deletions
+3 -1
View File
@@ -9,6 +9,8 @@ import { CellData } from 'common/buffer/CellData';
import { IBufferService, IOptionsService, IOscLinkService } from 'common/services/Services';
export class OscLinkProvider implements ILinkProvider {
private readonly _workCell = new CellData();
constructor(
@IBufferService private readonly _bufferService: IBufferService,
@IOptionsService private readonly _optionsService: IOptionsService,
@@ -25,7 +27,7 @@ export class OscLinkProvider implements ILinkProvider {
const result: ILink[] = [];
const linkHandler = this._optionsService.rawOptions.linkHandler;
const cell = new CellData();
const cell = this._workCell;
const lineLength = line.getTrimmedLength();
let currentLinkId = -1;
let currentStart = -1;