For every Equatable type the == operation is also defined for optionals:
public func ==(lhs: T?, rhs: T?) -> Bool
The non-optional on the right side gets automatically promoted to an optional.
The == for optionals returns true when both values are nil or if they are both non-nil and they are equal.