Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor(forms): remove unnecessary Array.from
The Array.from isn't necessary since we're just iterating over the map keys.
  • Loading branch information
garrettld committed May 15, 2023
commit f6da0f2d0bcb64219ebf16cb57294c3a64d5b6f7
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class SelectControlValueAccessor extends BuiltInControlValueAccessor impl

/** @internal */
_getOptionId(value: any): string|null {
for (const id of Array.from(this._optionMap.keys())) {
for (const id of this._optionMap.keys()) {
if (this._compareWith(this._optionMap.get(id), value)) return id;
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class SelectMultipleControlValueAccessor extends BuiltInControlValueAcces

/** @internal */
_getOptionId(value: any): string|null {
for (const id of Array.from(this._optionMap.keys())) {
for (const id of this._optionMap.keys()) {
if (this._compareWith(this._optionMap.get(id)!._value, value)) return id;
}
return null;
Expand Down