Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jdunkerley committed Jan 20, 2022
1 parent ae9a664 commit 14374ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -748,9 +748,9 @@ type Vector
this.fold Map.empty state->
item->
key = Mixed_Types_Map_Key (on item)
if (state.get_or_else key False) then state else
if (state.get_or_else key False) then existing else
builder.append item
state.insert key True
existing.insert key True

builder.to_vector

Expand Down
2 changes: 1 addition & 1 deletion test/Tests/src/Data/Vector_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ spec = Test.group "Vectors" <|
[1, 3, 1, 2, 2, 1].distinct . should_equal [1, 3, 2]
["a", "a", "a"].distinct . should_equal ["a"]
[].distinct . should_equal []
[1, 1.0, 2, 2.0].distinct . should_equal [1, 2]

Test.specify "should return a vector containing only unique mixed type elements" <|
[1, 1.0, 2, 2.0].distinct . should_equal [1, 2]
["a", 2].distinct . should_equal ["a", 2]
[2, "a", Integer, "a", 2].distinct . should_equal [2, "a", Integer]

Expand Down

0 comments on commit 14374ea

Please sign in to comment.