on main help sign in
chore: rename seq2
commitee45939529ad21391a7588b68e120fb104b6aaaa authorKujtim Hoxha <kujtimii.h@gmail.com> dateFri 25 Jul 2025, 16:00 (1 year ago) parente18a77f
2 files changed+3−3
internal/csync/slices.go+2−2 internal/csync/slices_test.go+1−1
internal/csync/slices.go+2−2
@@ -149,8 +149,8 @@ func (s *Slice[T]) Seq() iter.Seq[T] {
149149 }
150150}
151151
152−// SeqWithIndex returns an iterator that yields index-value pairs from the slice.
153−func (s *Slice[T]) SeqWithIndex() iter.Seq2[int, T] {
152+// Seq2 returns an iterator that yields index-value pairs from the slice.
153+func (s *Slice[T]) Seq2() iter.Seq2[int, T] {
154154 // Take a snapshot to avoid holding the lock during iteration
155155 items := s.Slice()
156156 return func(yield func(int, T) bool) {
internal/csync/slices_test.go+1−1
@@ -250,7 +250,7 @@ func TestSlice(t *testing.T) {
250250
251251 var indices []int
252252 var values []string
253− for i, v := range s.SeqWithIndex() {
253+ for i, v := range s.Seq2() {
254254 indices = append(indices, i)
255255 values = append(values, v)
256256 }