Redundant contains
for String#replace
#659
Labels
D-easy
Easy to implement.
enhancement
New feature or request
new-lint
A new lint.
unnecessary-complexity
What it does
It is redundant to check if something is in a string, before replacing it. If it is not there, it will not replace anything.
As a future extension: There might be other places where a contains is redundant, like for adding a value to a set?
Lint Name
REDUNDANT_CONTAINS
Category
complexity
Example
Could be written as:
The text was updated successfully, but these errors were encountered: