Pattern: Redundant nil
coalescing
Issue: -
nil
coalescing operator is only evaluated if the left-hand side is nil, coalescing operator with nil as right-hand side is redundant.
Examples of correct code:
var myVar: Int?; myVar ?? 0
Examples of incorrect code:
var myVar: Int? = nil; myVar↓ ?? nil
var myVar: Int? = nil; myVar↓??nil