sort list optimisations#8593
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8593 +/- ##
=======================================
Coverage 88.75% 88.75%
=======================================
Files 288 288
Lines 64263 64289 +26
Branches 8086 8090 +4
=======================================
+ Hits 57036 57062 +26
+ Misses 4892 4888 -4
- Partials 2335 2339 +4 🚀 New features to boost your workflow:
|
| { | ||
| return pointerList; | ||
| } | ||
|
|
There was a problem hiding this comment.
This looks like a useful optimization. Please move the variable declarations of sortedList and arrayIndex to after the new code. As it stands, certain builds may get "unused variable" warnings / errors depending on compile flags. And it makes the code more readable.
Also add a DESCRIPTION line to the commit message - this enables the fix to be automatically picked up by release notes - and maybe change the title to something more targeted to the PR, e.g "Short-circuit list sort on 0 or 1 elements".
With these adjustments we can merge the PR, thanks.
early return early when calling sortlist with <=1 element