Inspectopedia
 
2024.3

'List.indexOf()' expression can be replaced with 'contains()'

Warning
New
Last modified: 03 December 2024

Reports any List.indexOf() expressions that can be replaced with the List.contains() method.

Example:

The provided quick-fix replaces the indexOf call with the contains call: