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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 2 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
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. commit-queue Add this label to land a pull request using GitHub Actions. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants