Release unused file buffers for empty artifacts
This commit is contained in:
@@ -158,7 +158,7 @@ func readFileArtifact(ctx context.Context, path string, open func(string) (artif
|
||||
return nil, fmt.Errorf("failed to read file %s: %w", path, readErr)
|
||||
}
|
||||
}
|
||||
if len(data) > 0 && cap(data)-len(data) > len(data) {
|
||||
if cap(data)-len(data) > len(data) {
|
||||
// A stale size hint should not make a small completed artifact retain a
|
||||
// disproportionately large backing array.
|
||||
compact := make([]byte, len(data))
|
||||
|
||||
Reference in New Issue
Block a user