Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ec337b2

Browse filesBrowse files
Trotttargos
authored andcommitted
tools: replace for loop with map()
Refs: #41406 (comment) Co-authored-by: Tobias Nießen <tniessen@tnie.de> PR-URL: #41451 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
1 parent fa84353 commit ec337b2
Copy full SHA for ec337b2

File tree

Expand file treeCollapse file tree

1 file changed

+1
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-5
lines changed
Open diff view settings
Collapse file

‎tools/doc/allhtml.mjs‎

Copy file name to clipboardExpand all lines: tools/doc/allhtml.mjs
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,8 @@ all = all.slice(0, apiStart.index + apiStart[0].length) +
101101
fs.writeFileSync(new URL('./all.html', source), all, 'utf8');
102102

103103
// Validate all hrefs have a target.
104-
const ids = new Set();
105104
const idRe = / id="([^"]+)"/g;
106-
const idMatches = all.matchAll(idRe);
107-
for (const match of idMatches) {
108-
ids.add(match[1]);
109-
}
105+
const ids = new Set([...all.matchAll(idRe)].map((match) => match[1]));
110106

111107
const hrefRe = / href="#([^"]+)"/g;
112108
const hrefMatches = all.matchAll(hrefRe);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.