Uses Array.map.

This commit is contained in:
Henning Dieterichs 2021-11-09 13:27:09 +01:00
parent b2b3437743
commit d7ed0e3740
No known key found for this signature in database
GPG key ID: 771381EFFDB9EC06

View file

@ -185,14 +185,14 @@ export class ViewModelLinesFromProjectedModel implements IViewModelLines {
return false;
}
}
let newDecorations: IModelDeltaDecoration[] = [];
for (const newRange of newRanges) {
newDecorations.push({
range: newRange,
options: ModelDecorationOptions.EMPTY
});
}
const newDecorations = newRanges.map<IModelDeltaDecoration>(
(r) =>
({
range: r,
options: ModelDecorationOptions.EMPTY,
})
);
this.hiddenAreasDecorationIds = this.model.deltaDecorations(this.hiddenAreasDecorationIds, newDecorations);