if lhsCount != rhs.count { return false } + if lhsCount == 0 { + return true + } // Test referential equality. - if lhsCount == 0 || lhs._buffer.identity == rhs._buffer.identity { + if lhs._buffer.identity == rhs._buffer.identity + && !Element._containsExceptionalValues { return true }
==
が使えないのか。var d = [Float: String]() d[Float.nan] = "aaa" print(d[Float.nan]) // nil