Skip to content

Commit efa92ab

Browse files
garrettldAndrewKushnir
authored andcommitted
refactor(forms): remove unnecessary Array.from (#50314)
The Array.from isn't necessary since we're just iterating over the map keys. PR Close #50314
1 parent 7c790f7 commit efa92ab

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/forms/src/directives/select_control_value_accessor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class SelectControlValueAccessor extends BuiltInControlValueAccessor impl
147147

148148
/** @internal */
149149
_getOptionId(value: any): string|null {
150-
for (const id of Array.from(this._optionMap.keys())) {
150+
for (const id of this._optionMap.keys()) {
151151
if (this._compareWith(this._optionMap.get(id), value)) return id;
152152
}
153153
return null;

packages/forms/src/directives/select_multiple_control_value_accessor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export class SelectMultipleControlValueAccessor extends BuiltInControlValueAcces
179179

180180
/** @internal */
181181
_getOptionId(value: any): string|null {
182-
for (const id of Array.from(this._optionMap.keys())) {
182+
for (const id of this._optionMap.keys()) {
183183
if (this._compareWith(this._optionMap.get(id)!._value, value)) return id;
184184
}
185185
return null;

0 commit comments

Comments
 (0)