chore: rename seq2

Kujtim Hoxha created

Change summary

internal/csync/slices.go      | 4 ++--
internal/csync/slices_test.go | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

Detailed changes

internal/csync/slices.go 🔗

@@ -149,8 +149,8 @@ func (s *Slice[T]) Seq() iter.Seq[T] {
 	}
 }
 
-// SeqWithIndex returns an iterator that yields index-value pairs from the slice.
-func (s *Slice[T]) SeqWithIndex() iter.Seq2[int, T] {
+// Seq2 returns an iterator that yields index-value pairs from the slice.
+func (s *Slice[T]) Seq2() iter.Seq2[int, T] {
 	// Take a snapshot to avoid holding the lock during iteration
 	items := s.Slice()
 	return func(yield func(int, T) bool) {

internal/csync/slices_test.go 🔗

@@ -250,7 +250,7 @@ func TestSlice(t *testing.T) {
 
 		var indices []int
 		var values []string
-		for i, v := range s.SeqWithIndex() {
+		for i, v := range s.Seq2() {
 			indices = append(indices, i)
 			values = append(values, v)
 		}