Skip to content

[MINOR] refactor: Avoid unnecessary recursion - #1441

Merged
xianjingfeng merged 2 commits into
apache:masterfrom
EnricoMi:avoid-recursion
Jan 12, 2024
Merged

[MINOR] refactor: Avoid unnecessary recursion#1441
xianjingfeng merged 2 commits into
apache:masterfrom
EnricoMi:avoid-recursion

Conversation

@EnricoMi

@EnricoMi EnricoMi commented Jan 11, 2024

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Change the recursion of ShuffleReadClientImpl.readShuffleBlockData into an outer while(true) loop. Diff is best compared with whitespaces ignored.

Why are the changes needed?

The recursion in ShuffleReadClientImpl.readShuffleBlockData is not needed because the existing return statements also terminate the introduced outer loop. The recursion depth is limited by the number of consecutive empty segments.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Not tested.

@xianjingfeng xianjingfeng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks @EnricoMi

@codecov-commenter

codecov-commenter commented Jan 11, 2024

Copy link
Copy Markdown

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (5d027c0) 53.38% compared to head (95eafb7) 54.29%.

Files Patch % Lines
...che/uniffle/client/impl/ShuffleReadClientImpl.java 92.50% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1441      +/-   ##
============================================
+ Coverage     53.38%   54.29%   +0.91%     
  Complexity     2729     2729              
============================================
  Files           422      402      -20     
  Lines         24046    21685    -2361     
  Branches       2051     2051              
============================================
- Hits          12836    11774    -1062     
+ Misses        10412     9184    -1228     
+ Partials        798      727      -71     

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

@xianjingfeng
xianjingfeng merged commit 051b07a into apache:master Jan 12, 2024
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.

3 participants