quick

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package quick provides faster alternatives to common operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes[S ~string](s S) []byte

Bytes converts a string into a byte slice without extra allocations. Must not be used if the resulting byte slice could be mutated.

func Delete

func Delete[S ~[]E, E any](s S, i, j int) S

Delete removes the elements s[i:j] from s, returning the modified slice. Panics if j > len(s) or s[i:j] is not a valid slice of s. Performs fast removal without preserving the order of elements.

func Slice

func Slice[Out, In any, InSlice ~[]In](input InSlice) (output []Out)

Slice converts a slice of one type to a slice of another type without extra allocations. Use only when type In can be converted to type Out.

func SliceSafe

func SliceSafe[Out, In any, InSlice ~[]In](input InSlice) (output []Out)

SliceSafe converts a slice of one type to a slice of another type without extra allocations. Will panic if type In can't be converted to type Out.

func String

func String[B ~[]byte](b B) string

String converts a byte slice into a string without extra allocations. The bytes argument can be nil. Must not be used if the byte slice could be mutated.

Types

This section is empty.

Jump to

Keyboard shortcuts

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