refactor storage format and bpe handling; add redirecting bpe support and utility function for next largest number

This commit is contained in:
adman
2026-05-06 16:47:50 +02:00
parent be6d2fb461
commit c93d907d46
3 changed files with 26 additions and 21 deletions
+9
View File
@@ -85,3 +85,12 @@ func SliceRange[T Numeric](s, e T) (ret []T) {
func IsLastElement[T comparable](s []T, e T) bool {
return len(s) > 0 && s[len(s)-1] == e
}
func GetNextLargestNumberSlice[T Numeric](a T, s []T) (ret T, found bool) {
for _, v := range s {
if v > a {
return v, true
}
}
return
}