slice

package
v0.0.0-...-bb1a4e7 Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OrderedDelete

func OrderedDelete(slicePtr interface{}, idx int)

OrderedDelete removes the indexed element from the slice and moves the following elements to fill its place.

The slicePtr argument must be a pointer to a slice.

This performs the deletion in O(N) time, with the benefit that it preserves the order of the slice. For a deletion that ignores order, see UnorderedDelete.

func UnorderedDelete

func UnorderedDelete(slicePtr interface{}, idx int)

UnorderedDelete removes the indexed element from the slice, potentially changing the order of the slice in the process.

The slicePtr argument must be a pointer to a slice.

This performs the deletion in O(1) time, at the expense of re-ordering the set. For an order-preserving deletion, see OrderedDelete.

Types

This section is empty.

Jump to

Keyboard shortcuts

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