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:
Alan Agius 2025-04-16 10:11:14 +00:00 committed by kirjs
parent d1731687e1
commit c90eea2cd1

View file

@ -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);
}