Skip to content

fix: if yield function indicates loop finish, the iterator must finish immediately#12

Merged
aereal merged 1 commit into
mainfrom
fix-chunk
May 13, 2026
Merged

fix: if yield function indicates loop finish, the iterator must finish immediately#12
aereal merged 1 commit into
mainfrom
fix-chunk

Conversation

@aereal

@aereal aereal commented May 13, 2026

Copy link
Copy Markdown
Owner

No description provided.

@aereal aereal self-assigned this May 13, 2026
Copilot AI review requested due to automatic review settings May 13, 2026 09:21
@github-actions

Copy link
Copy Markdown

Code Metrics Report

Coverage Code to Test Ratio Test Execution Time
88.4% 1:2.2 11s

Code coverage of files in pull request scope (88.9%)

Files Coverage
seq/seq.go 88.9%

Reported by octocov

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes seq.Chunk so that when the downstream yield signals early termination (false), the iterator stops immediately instead of potentially yielding an extra chunk afterward.

Changes:

  • Update Chunk to return immediately when yield returns false (instead of break), preventing any further yields after early termination.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aereal aereal merged commit c0d4355 into main May 13, 2026
11 checks passed
@aereal aereal deleted the fix-chunk branch May 13, 2026 09:23
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