uniq

package
v0.0.0-...-113f59a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2024 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package uniq provides removal of adjacent duplicate elements in slices. It is similar to the unix command uniq.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModifySlice

func ModifySlice[E comparable](slice *[]E)

ModifySlice removes adjacent duplicate elements from the given slice. It adjusts the length of the slice appropriately and zeros the tail.

ModifySlice does O(len(*slice)) operations.

func ModifySliceFunc

func ModifySliceFunc[E any](slice *[]E, eq func(i, j E) bool)

ModifySliceFunc is the same as ModifySlice except that it allows using a custom comparison function.

eq should report whether the two provided elements are equal.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL