-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
minor bugs with empty_count #505
Comments
These issues are known, which is why the rule isn't on by default. See #206 for a discussion around that. |
ah, got it, didn't surface in the search. |
I don't get why the rule shouldn't check for |
Anecdotally I can say that enabling this rule helped find some inefficient zero comparisons in some |
example 1: if I just have a variable named count not associated with an array/object, the rule will trigger. maybe restrict the rule to only check for .count?
var count = 0
return count == 0 (trigger error warning)
as an extension, if I do if num + count > 0, the rule will trigger as well
example 2: (probably undetectable) - classes (ex. NSArray) can have .count but not .isEmpty
The text was updated successfully, but these errors were encountered: