OrderedSet icon indicating copy to clipboard operation
OrderedSet copied to clipboard

Equality not taking into account order

Open Aquilosion opened this issue 5 years ago • 0 comments

I notice the equality operator is not taking into account the order of the members:

public func ==<T>(lhs: OrderedSet<T>, rhs: OrderedSet<T>) -> Bool {
    return lhs.set == rhs.set
}

Is this intentional? I notice that NSOrderedSet does take their order into account:

Two ordered sets have equal contents if they each have the same number of members, if each member of one ordered set is present in the other, and the members are in the same order.

Should the equality operator not compare their internal arrays, instead?

Aquilosion avatar May 31 '19 08:05 Aquilosion