underscore/docs/content/collections/unique_in_place.md
Ruidy 9cf61ec6c5
feat: add ParallelFilter and UniqueInPlace functions
Add `ParallelFilter` for concurrent filtering with context and error
support.
Add `UniqueInPlace` to remove duplicates from slices in place. Update
README
and add documentation and tests for both functions.
2025-09-01 18:16:59 -04:00

347 B

title date
UniqueInPlace 2025-09-01T00:00:00-00:00

UniqueInPlace removes duplicates from a slice in place while preserving order. Returns the shortened slice.

package main

import (
 "fmt"
 u "github.com/rjNemo/underscore"
)

func main() {
 xs := []int{1,4,2,5,3,1,5,2}
 fmt.Println(u.UniqueInPlace(xs)) // [1 4 2 5 3]
}