Pattern: Missing use of isEmpty
Issue: -
Prefer checking isEmpty
over comparing collection to an empty array or dictionary literal.
Examples of correct code:
myArray = []
myArray.isEmpty
!myArray.isEmpy
myDict = [:]
Examples of incorrect code:
myArray↓ == []
myArray↓ != []
myArray↓ == [ ]
myDict↓ == [:]
myDict↓ != [:]
myDict↓ == [: ]
myDict↓ == [ :]
myDict↓ == [ : ]