Skip to content

Fix logic inversion on yield#150

Merged
fwiesel merged 1 commit into
mainfrom
fix_yield
Oct 14, 2025
Merged

Fix logic inversion on yield#150
fwiesel merged 1 commit into
mainfrom
fix_yield

Conversation

@fwiesel

@fwiesel fwiesel commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

The pattern is

for v := range s.m {
  if !yield(v) {
    return
  }
}

So, we need to return if yield() returns a false value, not a true value as in the old code.

The pattern is
```go
for v := range s.m {
  if !yield(v) {
    return
  }
}
```

So, we need to return if yield() returns a false value,
not a true value as in the old code.
@fwiesel fwiesel merged commit 26f3f2f into main Oct 14, 2025
6 checks passed
@notandy notandy deleted the fix_yield branch October 15, 2025 21:25
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