Skip to content

sort list optimisations#8593

Open
afn7081 wants to merge 1 commit into
citusdata:mainfrom
afn7081:users/afanankhan/sortlistOpt
Open

sort list optimisations#8593
afn7081 wants to merge 1 commit into
citusdata:mainfrom
afn7081:users/afanankhan/sortlistOpt

Conversation

@afn7081
Copy link
Copy Markdown

@afn7081 afn7081 commented May 21, 2026

early return early when calling sortlist with <=1 element

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.75%. Comparing base (c2bd6ae) to head (920ea57).
⚠️ Report is 1 commits behind head on main.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

{
return pointerList;
}

Copy link
Copy Markdown
Contributor

@colm-mchugh colm-mchugh May 21, 2026

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants