Skip to content

Commit

Permalink
update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrav committed Jan 17, 2024
1 parent dad92c5 commit 5220920
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/writers/buffered_file_writer/bufferedfilewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (w *BufferedFileWriter) Write(ctx context.Context, p []byte) (int, error) {
}

// Switch to file writing if threshold is exceeded.
// This helps in managing memory efficiently for large diffs.
// This helps in managing memory efficiently for large content.
if w.file == nil {
var err error
w.file, err = os.CreateTemp(os.TempDir(), cleantemp.MkFilename())
Expand All @@ -62,7 +62,7 @@ func (w *BufferedFileWriter) Write(ctx context.Context, p []byte) (int, error) {
}

// Transfer existing data in buffer to the file, then clear the buffer.
// This ensures all the diff data is in one place - either entirely in the buffer or the file.
// This ensures all the data is in one place - either entirely in the buffer or the file.
if w.buf.Len() > 0 {
ctx.Logger().V(4).Info("writing buffer to file", "content_size", w.buf.Len())
if _, err := w.file.Write(w.buf.Bytes()); err != nil {
Expand Down

0 comments on commit 5220920

Please sign in to comment.