去除不必要的异常过滤

This commit is contained in:
kercylan98 2023-05-23 14:17:28 +08:00
parent fb3128d11a
commit 5abb539bd0
1 changed files with 0 additions and 5 deletions

View File

@ -3,11 +3,6 @@ package slice
// Del 删除特定索引的元素
func Del[V any](slice *[]V, index int) {
s := *slice
if index < 0 {
index = 0
} else if index >= len(*slice) {
index = len(*slice) - 1
}
*slice = append(s[:index], s[index+1:]...)
}