Skip to content
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

Replace indexOf() with contains() #94

Merged
merged 1 commit into from May 25, 2021
Merged

Replace indexOf() with contains() #94

merged 1 commit into from May 25, 2021

Conversation

arturobernalg
Copy link
Member

jsparrow -->

'Most checks against an indexOf value compare it with -1 because 0 is a valid index. Any checks which look for values >0 ignore the first element, which is likely a bug. If the intent is merely to check inclusion of a value in a String or a List, the contains method is better suited to express this intent. Clearer intent means better readability.'

@coveralls
Copy link

Coverage Status

Coverage remained the same at 78.278% when pulling 7f02be4 on arturobernalg:feature/use_contains into 5165528 on apache:master.

@jochenw jochenw merged commit e7ecf9e into apache:master May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants