Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: replace while+exec() with matchAll() #41406

Merged
merged 1 commit into from
Jan 9, 2022

Conversation

Trott
Copy link
Member

@Trott Trott commented Jan 5, 2022

No description provided.

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. tools Issues and PRs related to the tools directory. labels Jan 5, 2022
Comment on lines 103 to 109
// Validate all hrefs have a target.
const ids = new Set();
const idRe = / id="([^"]+)"/g;
let match;
while (match = idRe.exec(all)) {
const idMatches = all.matchAll(idRe);
for (const match of idMatches) {
ids.add(match[1]);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional suggestion to get rid of a few statements:

const ids = new Set([...all.matchAll(idRe)].map((match) => match[1]));

Or even:

const ids =
  new Set([...all.matchAll(/ id="([^"]+)"/g)].map((match) => match[1]));

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 6, 2022
@Trott Trott added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 8, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 8, 2022
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@Trott Trott added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 9, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 9, 2022
@nodejs-github-bot nodejs-github-bot merged commit e247089 into nodejs:master Jan 9, 2022
@nodejs-github-bot
Copy link
Collaborator

Landed in e247089

@Trott Trott deleted the matchallall branch January 9, 2022 13:23
Trott added a commit to Trott/io.js that referenced this pull request Jan 9, 2022
Refs: nodejs#41406 (comment)
Co-authored-by: Tobias Nießen <tniessen@tnie.de>
Trott added a commit to Trott/io.js that referenced this pull request Jan 13, 2022
Refs: nodejs#41406 (comment)
Co-authored-by: Tobias Nießen <tniessen@tnie.de>

PR-URL: nodejs#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>
targos pushed a commit that referenced this pull request Jan 14, 2022
PR-URL: #41406
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
targos pushed a commit that referenced this pull request Jan 14, 2022
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>
mawaregetsuka pushed a commit to mawaregetsuka/node that referenced this pull request Jan 17, 2022
Refs: nodejs#41406 (comment)
Co-authored-by: Tobias Nießen <tniessen@tnie.de>

PR-URL: nodejs#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>
thedull pushed a commit to thedull/node that referenced this pull request Jan 18, 2022
PR-URL: nodejs#41406
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
thedull pushed a commit to thedull/node that referenced this pull request Jan 18, 2022
Refs: nodejs#41406 (comment)
Co-authored-by: Tobias Nießen <tniessen@tnie.de>

PR-URL: nodejs#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>
Linkgoron pushed a commit to Linkgoron/node that referenced this pull request Jan 31, 2022
PR-URL: nodejs#41406
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Linkgoron pushed a commit to Linkgoron/node that referenced this pull request Jan 31, 2022
Refs: nodejs#41406 (comment)
Co-authored-by: Tobias Nießen <tniessen@tnie.de>

PR-URL: nodejs#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>
danielleadams pushed a commit that referenced this pull request Feb 1, 2022
PR-URL: #41406
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
danielleadams pushed a commit that referenced this pull request Feb 1, 2022
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>
@danielleadams danielleadams mentioned this pull request Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants