New issue
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
[SR-12648] RangeReplaceableCollection's 'filter' uses an intermediate array #55092
Comments
Comment by Pedro Carrasco (JIRA) Hey! I'd like to try to tackle this issue. This would be my first time contributing to the Swift Language and I'll need some guidance on where to start, hints and/or anything that you believe I should know/be aware of. |
I'll try to help out. :-) The first step would be to get Swift building, as described in the Readme at https://github.com/apple/swift. You'd then make the change and write a test…but in this case I'm not actually sure how to write a test for this change. So my suggestion is to make the change and open a pull request, and ask at that point if the standard library reviewers have any ideas for testing it. Oh, and you can assign this issue to yourself so someone else doesn't take it. Let me/us know if you have any specific questions! |
Comment by Pedro Carrasco (JIRA) Thanks @belkadan! I've already assigned this issue to me and I'll work on it on the upcoming days. I'll let you know if I have any problem � |
Comment by Pedro Carrasco (JIRA) I haven't been able to find time to work on this but I'll try to open a PR this week. If I'm not able to do so, I'll remove myself from this issue so someone else can tackle it. |
Comment by Pedro Carrasco (JIRA) Turns out I'm still lacking time and I currently don't have enough disk storage to be able to properly build and test Swift. |
Comment by Valeriy Van (JIRA) PR #31911 |
Comment by Valeriy Van (JIRA) merged |
Comment by Valeriy Van (JIRA) Fix was merged #31911 |
Additional Detail from JIRA
md5: d697e9673a4531a522d6c0386307389b
Issue Description:
RangeReplaceableCollection has an overload of
filter
that producesSelf
:As written, this is intended to be constructing the new collection by lazily evaluating the predicate…but lazy filters don't support throwing closures, so this is actually just using the eager
filter
on Sequence that produces an Array. It should be replaced with a simple loop that appends elements one-by-one to a newSelf
value.The text was updated successfully, but these errors were encountered: