You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If this is a new rule request, please ignore all sections below this one, format
this issue's title as Rule Request: [Rule Name] and describe:
Why should this rule be added? Share links to existing discussion about what
the community thinks about this.
First sorting a sequence and then just reading the first or last element is unnecessarily consuming memory and is much slower (O(n log(n))) than searching for the minimum element in a sequence (O(n)).
Provide several examples of what would and wouldn't trigger violations.
// Should not triggerletmin= myList.min()\n
letmin= myList.min(by:{ $0.description < $1.description })letmin= myList.min(by:>)letmin= myList.max()letmin= myList.max(by:{ $0 < $1 })
Should the rule be configurable, if so what parameters should be configurable?
Just severity.
Should the rule be opt-in or enabled by default? Why?
The rule may lead to false positives on non-sequence API where there is no min/max function. Similar to first_where and contains_over_first_not_nil this rule should be opt-in.
The text was updated successfully, but these errors were encountered:
New Issue Checklist
Rule Request
If this is a new rule request, please ignore all sections below this one, format
this issue's title as
Rule Request: [Rule Name]
and describe:Why should this rule be added? Share links to existing discussion about what
the community thinks about this.
First sorting a sequence and then just reading the first or last element is unnecessarily consuming memory and is much slower (
O(n log(n))
) than searching for the minimum element in a sequence (O(n)
).Provide several examples of what would and wouldn't trigger violations.
Just severity.
The rule may lead to false positives on non-sequence API where there is no min/max function. Similar to
first_where
andcontains_over_first_not_nil
this rule should be opt-in.The text was updated successfully, but these errors were encountered: