Skip to content

Conversation

@mrhooray
Copy link
Owner

@mrhooray mrhooray commented Nov 8, 2025

Summary

  • Extract common logic into within_impl() and within_evaluated_heap() helpers
  • Reduce code duplication from 3 nearly identical methods to shared implementation
  • Maintain identical public API behavior while reducing maintenance burden
  • All existing tests pass without modification

This refactors the three within* methods (within, within_unsorted, within_count) which had significant code duplication in their validation and heap evaluation logic.

- Extract common logic into within_impl() and within_evaluated_heap() helpers
- Reduce code duplication from 3 nearly identical methods to shared implementation
- Maintain identical public API behavior while reducing maintenance burden
- All existing tests pass without modification
@mrhooray mrhooray force-pushed the refactor-within-methods branch from 69502f8 to 599fbc6 Compare November 8, 2025 18:45
@mrhooray
Copy link
Owner Author

mrhooray commented Nov 8, 2025

Closing this PR in favor of #82 which provides a cleaner long-term API solution. PR #82 implements the simpler approach of having within() return unsorted results only, eliminating the need for both within() and within_unsorted() methods.

@mrhooray mrhooray closed this Nov 8, 2025
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