Skip to content

Commit

Permalink
replace filter with find function
Browse files Browse the repository at this point in the history
  • Loading branch information
JiglioNero committed Sep 2, 2020
1 parent 9e398c7 commit 13bba6b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/smoke/package/src/helpers/iosSimulatorHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ export class IosSimulatorHelper {
}

public static findSimulator(simulators: IiOSSimulator[], name: string, system?: string): IiOSSimulator | null {
const foundSimulators = simulators.filter((value) => value.name === name && (!system || value.system === system));
if (foundSimulators.length === 0) {
const foundSimulator = simulators.find((value) => value.name === name && (!system || value.system === system));
if (!foundSimulator) {
return null;
}
return foundSimulators[0];
return foundSimulator;
}

public static collectSimulators(): IiOSSimulator[] {
Expand Down

0 comments on commit 13bba6b

Please sign in to comment.