Skip to content

Commit

Permalink
Update drivers/r2/driver.go
Browse files Browse the repository at this point in the history
Co-authored-by: Caner Çıdam <[email protected]>
  • Loading branch information
aomerk and canercidam authored Jan 10, 2024
1 parent 349793e commit 6bd514f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/r2/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ func (w *writer) flushPart() error {
// Check if the ready part is less than the chunk size
if len(w.readyPart) < int(w.driver.ChunkSize) {
// If there's enough in the pending part to fill the ready part up to the chunk size
if len(w.pendingPart) >= int(w.driver.ChunkSize)-len(w.readyPart) {
if len(w.pendingPart) + len(w.readyPart) >= int(w.driver.ChunkSize) {
fillSize := int(w.driver.ChunkSize) - len(w.readyPart)
w.readyPart = append(w.readyPart, w.pendingPart[:fillSize]...)
w.pendingPart = w.pendingPart[fillSize:]
Expand Down

0 comments on commit 6bd514f

Please sign in to comment.