-
-
Notifications
You must be signed in to change notification settings - Fork 158
Remove unnecessary allocations and clones #350
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
Remove unnecessary allocations and clones #350
Conversation
This improves developer ergonomics
the call to `clone()` should not happen before the early return
Codecov Report
@@ Coverage Diff @@
## master #350 +/- ##
==========================================
- Coverage 96.11% 95.06% -1.05%
==========================================
Files 34 34
Lines 2419 2310 -109
==========================================
- Hits 2325 2196 -129
- Misses 94 114 +20
Continue to review full report at Codecov.
|
|
I'm not familiar with codecov. Is there a way to see, which branch was covered by testing before, and is not covered after this change? |
|
1a5e70a is a personal preference. I like the iterator API better than |
I like this approach too 🙂 |
You can find the diff here https://app.codecov.io/gh/dotenv-linter/dotenv-linter/compare/350/diff |
|
@vbrandl Thank you for your contribution! 🔥
Please do it 🙂 |
I still cannot really tell, which branches, that were covered before, are not covered now, so I know for which cases, new tests are required. |
|
It might actually be interesting to rerun the benchmarks from #351 to see, if these changes have a measurable impact |
|
@vbrandl Thanks a lot 🚀 You did a great job 👍 |
|
|
I count cutting down the max execution time by almost 50% as a win, even if it's indistinguishable for humans :D |
You are awesome ⚡️ |
Another PR by me :)
When working on my last change, I saw a few unnecessary
clones,to_strings,to_owneds and so on. This change tries to remove them where possible and therefore improve the runtime performance by getting rid of a few heap allocations and memory copies.There are no new features, so I didn't write new tests, but the existing tests still pass :)
✔ Checklist: