tools

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const InfiniteTimes int = -1 // 无限次

Variables

This section is empty.

Functions

func IfThenElse

func IfThenElse[T any](b bool, t, f T) T

func Loop

func Loop(f func() bool, times ...int)

Loop 重复执行 f函数,直到其返回false.每执行 times 次,会交出 cpu 时间片

func SliceFindMaxN

func SliceFindMaxN(t []compare.Item, n int) []compare.Item

SliceFindMaxN 从切片中返回较大的n个数据

func SliceFindMinN

func SliceFindMinN(t []compare.Item, n int) []compare.Item

SliceFindMinN 从切片中返回较小的n个数据

func SliceSplitMinN

func SliceSplitMinN(t []compare.Item, n int) (s []compare.Item, b []compare.Item)

SliceSplitMinN 从切片中分离出较小的n个数据

Types

This section is empty.

Jump to

Keyboard shortcuts

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