You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@rklaehn said:
It is OK and even sometimes necessary for a HashTrieSet to have one entry if the entry is a HashTrieSet itself. But if the entry is a HashSet1 or a HashSetCollision1 it should be prevented.
A set with one element should not be represented by HashSet.HashTrieSet, but by HashSet.HashSet1.
In the example below, y should be an instance of HashSet1 instead of HashTrieSet. A HashTrieSet with one element is redundant.
val x = HashSet(1,2)
val y = x - 1
println(y + " " + y.getClass)
// Set(2) class scala.collection.immutable.HashSet$HashTrieSet
The text was updated successfully, but these errors were encountered: