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 5fe7cfa

Browse filesBrowse files
tniessenBethGriggs
authored andcommitted
tools: use Set instead of { [key]: true } object
PR-URL: #41675 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 12c1ac4 commit 5fe7cfa
Copy full SHA for 5fe7cfa

File tree

Expand file treeCollapse file tree

1 file changed

+3
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-6
lines changed
Open diff view settings
Collapse file

‎tools/doc/allhtml.mjs‎

Copy file name to clipboardExpand all lines: tools/doc/allhtml.mjs
+3-6Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@ let apicontent = '';
1818

1919
// Identify files that should be skipped. As files are processed, they
2020
// are added to this list to prevent dupes.
21-
const seen = {
22-
'all.html': true,
23-
'index.html': true
24-
};
21+
const seen = new Set(['all.html', 'index.html']);
2522

2623
for (const link of toc.match(/<a.*?>/g)) {
2724
const href = /href="(.*?)"/.exec(link)[1];
28-
if (!htmlFiles.includes(href) || seen[href]) continue;
25+
if (!htmlFiles.includes(href) || seen.has(href)) continue;
2926
const data = fs.readFileSync(new URL(`./${href}`, source), 'utf8');
3027

3128
// Split the doc.
@@ -68,7 +65,7 @@ for (const link of toc.match(/<a.*?>/g)) {
6865
.trim() + '\n';
6966

7067
// Mark source as seen.
71-
seen[href] = true;
68+
seen.add(href);
7269
}
7370

7471
// Replace various mentions of index with all.

0 commit comments

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