Skip to content

Conversation

@snofla
Copy link
Owner

@snofla snofla commented May 12, 2025

Adds an idiomatic rule that suggests using reduce(into:) when a for .. in loop is encountered that references a collection variable (of type Array, Set or Dictionary).

The canonical example is:

            var result: [SomeType] = []
            for eachN in someSequence {
                ↓result[someIndex] = eachN
            }

@snofla snofla merged commit 6ef9351 into main May 12, 2025
2 of 3 checks passed
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