From 553e9e95f446a7b56b5eba6662eefbfd8e0a1230 Mon Sep 17 00:00:00 2001 From: qydysky Date: Sun, 28 Jan 2024 16:46:03 +0800 Subject: [PATCH] 1 --- slice/Slice.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slice/Slice.go b/slice/Slice.go index 616d271..71c7cdf 100644 --- a/slice/Slice.go +++ b/slice/Slice.go @@ -160,7 +160,7 @@ func (t *Buf[T]) GetCopyBuf() (buf []T) { return } -func DelFront[S ~[]*T, T any](s *S, beforeIndex int) { +func DelFront[S ~[]T, T any](s *S, beforeIndex int) { *s = (*s)[:copy(*s, (*s)[beforeIndex+1:])] } @@ -170,7 +170,7 @@ func AddFront[S ~[]*T, T any](s *S, t *T) { (*s)[0] = t } -func DelBack[S ~[]*T, T any](s *S, fromIndex int) { +func DelBack[S ~[]T, T any](s *S, fromIndex int) { *s = (*s)[:fromIndex] } -- 2.39.2