Skip to content

Refactor handle_reclaims to avoid option wrap/unwrap #8113

Merged
HaoranYi merged 1 commit intoanza-xyz:masterfrom
HaoranYi:refactor_reclaim_1
Sep 19, 2025
Merged

Refactor handle_reclaims to avoid option wrap/unwrap #8113
HaoranYi merged 1 commit intoanza-xyz:masterfrom
HaoranYi:refactor_reclaim_1

Conversation

@HaoranYi
Copy link
Copy Markdown

@HaoranYi HaoranYi commented Sep 19, 2025

Problem

Split from #7624

This PR refactors handle_reclaims function and its callers to eliminate option wrapper.

Summary of Changes

  1. Simplified handle_reclaims Function Signature
  • Changed the first parameter from Option to I directly
  • Removed the conditional wrapper logic that was checking for Some(reclaims)
  • Streamlined the function flow by removing unnecessary nesting
  1. Updated Caller Sites
  • Replaced (!reclaims.is_empty()).then(|| reclaims.iter()) pattern with direct reclaims.iter() calls
  • Added explicit empty checks at call sites before invoking handle_reclaims.
  • Early returns for empty reclaims to avoid unnecessary function calls
  1. Remove a debug log.

Fixes #

filter

bug

revert update index change
@HaoranYi HaoranYi changed the title refactor handle_relcaim to avoid vec copies Refactor/optimize handle_reclaims to avoid option wrap/unwrap Sep 19, 2025
@HaoranYi HaoranYi changed the title Refactor/optimize handle_reclaims to avoid option wrap/unwrap Refactor handle_reclaims to avoid option wrap/unwrap Sep 19, 2025
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.9%. Comparing base (d62b6e0) to head (deee890).
⚠️ Report is 24 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #8113     +/-   ##
=========================================
- Coverage    82.9%    82.9%   -0.1%     
=========================================
  Files         823      823             
  Lines      360470   360469      -1     
=========================================
- Hits       299068   299060      -8     
- Misses      61402    61409      +7     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

:shipit:

MarkAccountsObsolete::No,
);
measure.stop();
debug!("{measure}");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR also is removing this debug log.

I think it's fine, but not something I was expecting to see based on the PR's title and description.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good catch — I have updated the description to mention the removal of that debug log as well.

@HaoranYi HaoranYi merged commit dba8842 into anza-xyz:master Sep 19, 2025
43 checks passed
@HaoranYi HaoranYi deleted the refactor_reclaim_1 branch September 19, 2025 19:22
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