fix(frontend): improve performance by reducing array constructions

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-06-26 00:09:07 +02:00
parent 28f04f461c
commit ced4cd953c
6 changed files with 26 additions and 24 deletions

View file

@ -63,10 +63,7 @@ export class LineContentToLineIdMapper {
LineContentToLineIdMapper.changeIsNotChangingLines(change) ||
LineContentToLineIdMapper.changeIsAddingLines(change)
)
.reduce(
(previousLineKeys, currentChange) => [...previousLineKeys, ...this.convertChangeToLinesWithIds(currentChange)],
[] as LineWithId[]
)
.flatMap((currentChange) => this.convertChangeToLinesWithIds(currentChange))
}
/**