es6 - use more find over filter

This commit is contained in:
Benjamin Pasero
2020-05-04 09:44:53 +02:00
parent fa63b8e240
commit b19b7a7f41
8 changed files with 18 additions and 19 deletions

View File

@@ -937,7 +937,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
// Multi Montior (fullscreen): try to find the previously used display
if (state.display && state.mode === WindowMode.Fullscreen) {
const display = displays.filter(d => d.id === state.display)[0];
const display = displays.find(d => d.id === state.display);
if (display && typeof display.bounds?.x === 'number' && typeof display.bounds?.y === 'number') {
this.logService.trace('window#validateWindowState: restoring fullscreen to previous display');