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

perf(cli,http,ini,internal,media-types): replace trim() comparisons with regexps #5751

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

timreichen
Copy link
Contributor

Changes
This replaces comparisons done with trim() with RegExp.test()

Reasoning
trim() creates a new string which is only used for the comparison and thus not memory efficient.

Copy link

codecov bot commented Aug 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.28%. Comparing base (99200dc) to head (005d062).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5751   +/-   ##
=======================================
  Coverage   96.28%   96.28%           
=======================================
  Files         474      474           
  Lines       38383    38389    +6     
  Branches     5578     5579    +1     
=======================================
+ Hits        36957    36964    +7     
+ Misses       1384     1383    -1     
  Partials       42       42           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kt3k kt3k changed the title chore: replace trim() comparisons with regexps perf(cli,http,ini,internal,media-types): replace trim() comparisons with regexps Aug 21, 2024
Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM. Nice!

@kt3k kt3k merged commit 644e03b into denoland:main Aug 21, 2024
17 checks passed
@timreichen timreichen deleted the remove-trim-comparisons branch August 21, 2024 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants