lo
lo copied to clipboard
Undefined behaviors on duplicate values in collections
https://github.com/samber/lo/blob/75ed9bb40ff4ec3d50adf5d8a5e34644ab492516/intersect.go#L48
In: Intersect[int]([]int{0, 6, 0}, []int{0, 1, 2, 3, 5, 5, 6, 6})
Out: []int{0, 6, 6}
In: Difference[int]([]int{0, 1, 2, 3, 3, 4, 4}, []int{0, 1, 2, 2, 3, 5, 5})
Out: []int{4, 4}, []int{5, 5}
In: Union[int]([]int{0, 1, 2, 3, 3, 5, 6, 6}, []int{0, 1, 2, 4, 4, 5, 5, 6})
Out: []int{0, 1, 2, 3, 3, 5, 6, 6, 4, 4}
Hello, these functions are dealing with duplicate values differently. Is there a rule that the collections disallow duplicates?
Related to #45