Minimize array allocations by blakeembrey · Pull Request #437 · pillarjs/path-to-regexp (original) (raw)
Changing a couple of code paths to remove array allocations entirely without any changes to code behavior.
Codecov Report
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.75%. Comparing base (57247e6) to head (d679ff6).
⚠️ Report is 1 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@ ## master #437 +/- ##
Coverage 99.74% 99.75%
Files 1 1
Lines 398 400 +2
Branches 158 161 +3
- Hits 397 399 +2
Misses 1 1
☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.
🚀 New features to boost your workflow:
- ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
| const stack = (error as Error).stack |
|---|
| ?.split("\n") |
| .slice(0, 5) |
| .slice(0, 6) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introducing process for handling the recursive array introduces an extra stack. In a new major we should drop the ability to have infinite recursion and we won't need this function anymore. But for now it avoids a new array getting created.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})