mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(common): eliminate redundant iterator-to-array conversion (#60884)
Simplifies code by removing unnecessary `Array.from` usage. PR Close #60884
This commit is contained in:
@@ -127,9 +127,8 @@ export class PreconnectLinkChecker {
|
||||
|
||||
private queryPreconnectLinks(): Set<string> {
|
||||
const preconnectUrls = new Set<string>();
|
||||
const selector = 'link[rel=preconnect]';
|
||||
const links: HTMLLinkElement[] = Array.from(this.document.querySelectorAll(selector));
|
||||
for (let link of links) {
|
||||
const links = this.document.querySelectorAll<HTMLLinkElement>('link[rel=preconnect]');
|
||||
for (const link of links) {
|
||||
const url = getUrl(link.href, this.window!);
|
||||
preconnectUrls.add(url.origin);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user