@@ -68,7 +68,7 @@ type ListPager struct {
6868// ListPager.PageBufferSize chunks buffered concurrently in the background.
6969//
7070// If items passed to fn are retained for different durations, and you want to avoid
71- // retaining the whole slice returned by p.PageFn as long as any item is referenced,
71+ // retaining the whole slice returned by p.Reader.List as long as any item is referenced,
7272// use EachListItemWithAlloc instead.
7373func (p * ListPager ) EachListItem (ctx context.Context , list client.ObjectList , fn func (obj client.Object ) error , opts ... client.ListOption ) error {
7474 return p .eachListChunkBuffered (ctx , list , func (list client.ObjectList ) error {
@@ -78,13 +78,13 @@ func (p *ListPager) EachListItem(ctx context.Context, list client.ObjectList, fn
7878 }, opts ... )
7979}
8080
81- // EachListItemWithAlloc works like EachListItem, but avoids retaining references to the items slice returned by p.PageFn .
82- // It does this by making a shallow copy of non-pointer items in the slice returned by p.PageFn .
81+ // EachListItemWithAlloc works like EachListItem, but avoids retaining references to the items slice returned by p.Reader.List .
82+ // It does this by making a shallow copy of non-pointer items in the slice returned by p.Reader.List .
8383//
8484// If the items passed to fn are not retained, or are retained for the same duration, use EachListItem instead for memory efficiency.
8585func (p * ListPager ) EachListItemWithAlloc (ctx context.Context , list client.ObjectList , fn func (obj client.Object ) error , opts ... client.ListOption ) error {
8686 return p .eachListChunkBuffered (ctx , list , func (list client.ObjectList ) error {
87- return meta .EachListItem (list , func (obj runtime.Object ) error {
87+ return meta .EachListItemWithAlloc (list , func (obj runtime.Object ) error {
8888 return fn (obj .(client.Object ))
8989 })
9090 }, opts ... )
0 commit comments