We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I propose a tiny, but I think helpful, addition to the iter package.
func Contains[K comparable](seq iter.Seq[K], val K) bool { for k := range seq { if k == val { return true } } return false }
This avoids the need to collect the iter.Seq[K] into a slice.
This could be extended to ContainsFunc.
It could also be extended to Contains2 and Contains2Func, but that may be a bit more strained.
The text was updated successfully, but these errors were encountered:
Duplicate of #67453
Sorry, something went wrong.
No branches or pull requests
Proposal Details
I propose a tiny, but I think helpful, addition to the iter package.
This avoids the need to collect the iter.Seq[K] into a slice.
This could be extended to ContainsFunc.
It could also be extended to Contains2 and Contains2Func, but that may be a bit more strained.
The text was updated successfully, but these errors were encountered: