diff --git a/distribution/lib/Standard/Base/0.2.32-SNAPSHOT/src/Data/Vector.enso b/distribution/lib/Standard/Base/0.2.32-SNAPSHOT/src/Data/Vector.enso index 47f379ffaa..a4fb886244 100644 --- a/distribution/lib/Standard/Base/0.2.32-SNAPSHOT/src/Data/Vector.enso +++ b/distribution/lib/Standard/Base/0.2.32-SNAPSHOT/src/Data/Vector.enso @@ -755,6 +755,16 @@ type Vector [Pair 1 "a", Pair 2 "b", Pair 1 "c"] . distinct (on = _.first) == [Pair 1 "a", Pair 2 "b"] distinct : (Any -> Any) -> Vector Any distinct (on = x->x) = + ## TODO [JD] This is based on the Map class until a HashMap is available. + + Current implementation allows for a consistent distinct with the Enso `==` operator. + Using the Map, is less efficient than a HashMap based as requires searching the tree (O(Log N)). + A HashMap would allow for a O(1) operation to confirm if an item has been seen already. + There is no native HashMap within Enso at present, and the polyglot approach does not produce + consistent results with the `==` operator. + + More details on the HashCode / HashMap ticket https://www.pivotaltracker.com/story/show/181027272. + recovered = Panic.recover builder = here.new_builder this.fold Map.empty existing->