Подготовить HY2XS к production-сборке

This commit is contained in:
2026-04-25 23:13:12 +05:00
commit 84a4e94567
277 changed files with 26513 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
package util
func ArrContain[T comparable](arr []T, key T) bool {
for _, item := range arr {
if item == key {
return true
}
}
return false
}
func SplitArr[T any](arr []T, num int) [][]T {
length := len(arr)
if length <= num {
return [][]T{arr}
}
quantity := (length + num - 1) / num
segments := make([][]T, 0, quantity)
for i := 0; i < quantity; i++ {
end := (i + 1) * num
if end > length {
end = length
}
segment := arr[i*num : end]
segments = append(segments, segment)
}
return segments
}