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

assert: optimize partial comparison of two Sets #55970

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Nov 23, 2024

We can skip the conversion to an array of the expected items as we're only iterating over them. Using a labelled continue should also slightly improve perf as we no longer need to keep a found boolean value and check its value.
I'm also removing the TODO that no longer applies (I suggested adding it when there were plans for a assert.includes method in the PR which have since been abandoned). Lastly I'm using the SafeSet methods to iterate over the Set instances to be consistent with how we iterate over Map instances just a few lines above.

@nodejs-github-bot nodejs-github-bot added assert Issues and PRs related to the assert subsystem. needs-ci PRs that need a full CI run. labels Nov 23, 2024
Copy link

codecov bot commented Nov 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.00%. Comparing base (d0d5209) to head (9bc3511).
Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55970      +/-   ##
==========================================
- Coverage   88.00%   88.00%   -0.01%     
==========================================
  Files         653      653              
  Lines      188091   188083       -8     
  Branches    35946    35949       +3     
==========================================
- Hits       165526   165517       -9     
+ Misses      15739    15732       -7     
- Partials     6826     6834       +8     
Files with missing lines Coverage Δ
lib/assert.js 99.01% <100.00%> (-0.01%) ⬇️

... and 29 files with indirect coverage changes

---- 🚨 Try these New Features:

@targos targos added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 24, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 24, 2024
@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 24, 2024
@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 24, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 25, 2024
@nodejs-github-bot nodejs-github-bot merged commit a43a283 into nodejs:main Nov 25, 2024
72 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in a43a283

@aduh95 aduh95 deleted the optimize-set-partial-comp branch November 25, 2024 19:25
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Nov 26, 2024
PR-URL: nodejs#55970
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
aduh95 added a commit that referenced this pull request Nov 26, 2024
PR-URL: #55970
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
aduh95 added a commit that referenced this pull request Dec 13, 2024
PR-URL: #55970
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
aduh95 added a commit that referenced this pull request Dec 13, 2024
PR-URL: #55970
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
aduh95 added a commit that referenced this pull request Dec 13, 2024
PR-URL: #55970
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assert Issues and PRs related to the assert subsystem. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants