From ee45939529ad21391a7588b68e120fb104b6aaaa Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Fri, 25 Jul 2025 16:00:18 +0200 Subject: [PATCH] chore: rename seq2 --- internal/csync/slices.go | 4 ++-- internal/csync/slices_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/csync/slices.go b/internal/csync/slices.go index 4e67ac1a127f577d1d13673e4311b2ea44e17393..ba47062b51de1a038836467f15bd4e9672ab3303 100644 --- a/internal/csync/slices.go +++ b/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) { diff --git a/internal/csync/slices_test.go b/internal/csync/slices_test.go index fd1bd69ba6ca4d07cd5383cb52746e41caa8d901..d86b02537fe0534ed60de0e314e1e1d9b7b866b6 100644 --- a/internal/csync/slices_test.go +++ b/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) }