tools

package
v1.3.11 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 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 []compare2.Item, n int) []compare2.Item

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

func SliceFindMinN

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

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

func SliceSplitMinN

func SliceSplitMinN(t []compare2.Item, n int) (s []compare2.Item, b []compare2.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