Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Commit

Permalink
use stream.ReadAll where it makes sense
Browse files Browse the repository at this point in the history
Signed-off-by: Achille Roussel <[email protected]>
  • Loading branch information
achille-roussel committed May 30, 2023
1 parent adac0ed commit 8905c14
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions internal/timemachine/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,8 @@ func (reg *Registry) LookupLogManifest(ctx context.Context, processID format.UUI
segments := reg.ListLogSegments(ctx, processID)
defer segments.Close()

it := stream.Iter[format.LogSegment](segments)
for it.Next() {
m.Segments = append(m.Segments, it.Value())
}
if err := it.Err(); err != nil {
m.Segments, err = stream.ReadAll[format.LogSegment](segments)
if err != nil {
return nil, err
}

Expand Down

0 comments on commit 8905c14

Please sign in to comment.