Skip to content

Commit

Permalink
slice: remove deprecated Dedup and Reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
creachadair committed Jan 9, 2025
1 parent bbfc09d commit 1638587
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions slice/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package slice

import (
"iter"
"slices"
)

// Partition rearranges the elements of vs in-place so that all the elements v
Expand Down Expand Up @@ -75,22 +74,6 @@ func Partition[T any](vs []T, keep func(T) bool) []T {
return vs[:i:i]
}

// Dedup rearranges the elements of vs in-place to deduplicate consecutive runs
// of identical elements. It returns a prefix of vs that contains the first
// element of each run found.
//
// Deprecated: Use the equivalent [slices.Compact] instead.
func Dedup[T comparable](vs []T) []T {
return slices.Compact(vs)
}

// Reverse reverses the contents of vs in-place.
//
// Deprecated: Use the equivalent [slices.Reverse] instead.
func Reverse[T any, Slice ~[]T](vs Slice) {
slices.Reverse(vs)
}

// Zero sets all the elements of vs to their zero value.
func Zero[T any, Slice ~[]T](vs Slice) {
var zero T
Expand Down

0 comments on commit 1638587

Please sign in to comment.