Inspectopedia
 
2024.3

Redundant operation on empty container

Warning
New
Last modified: 03 December 2024

Reports redundant operations on empty collections, maps or arrays.

Iterating, removing elements, sorting, and some other operations on empty collections have no effect and can be removed. Also, they may be a signal of a bug.

Example:

New in 2019.1