Removed unnecessary functions (using `staticcheck`)

master
Aadhavan Srinivasan 6 days ago
parent e671137493
commit 3f5f8fad2c

@ -54,16 +54,6 @@ func assert(cond bool) {
} }
} }
func deleteFromSlice[T comparable](slc []T, val T) []T {
toReturn := make([]T, 0, len(slc))
for _, v := range slc {
if v != val {
toReturn = append(toReturn, v)
}
}
return toReturn
}
// Ensure that the given elements are only appended to the given slice if they // Ensure that the given elements are only appended to the given slice if they
// don't already exist. Returns the new slice, and the number of unique items appended. // don't already exist. Returns the new slice, and the number of unique items appended.
func unique_append[T comparable](slc []T, items ...T) ([]T, int) { func unique_append[T comparable](slc []T, items ...T) ([]T, int) {
@ -149,13 +139,6 @@ func allCases(r rune) []rune {
return []rune{unicode.ToLower(r), unicode.ToUpper(r), unicode.ToTitle(r)} return []rune{unicode.ToLower(r), unicode.ToUpper(r), unicode.ToTitle(r)}
} }
// Expands a slice to the given length
func expandSlice[T any](slc []T, newSize int) []T {
toRet := make([]T, newSize)
copy(toRet, slc)
return toRet
}
func isHex(c rune) bool { func isHex(c rune) bool {
return slices.Contains([]rune("0123456789abcdefABCDEF"), c) return slices.Contains([]rune("0123456789abcdefABCDEF"), c)
} }

Loading…
Cancel
Save