Inspectopedia
 
2024.3

Size zero check can be replaced with 'isEmpty()'

Info
New
Last modified: 03 December 2024

Reports size == 0 checks on Collections/Array/String that should be replaced with isEmpty().

Using isEmpty() makes your code simpler.

The quick-fix replaces the size check with isEmpty().

Example:

After the quick-fix is applied: