mirror of
https://github.com/kopia/kopia.git
synced 2026-03-13 19:57:27 -04:00
better fix for aliasing issue
This commit is contained in:
@@ -141,6 +141,7 @@ func (bm *Manager) setPendingBlock(i Info) {
|
||||
func (bm *Manager) addToPackLocked(ctx context.Context, blockID string, data []byte, isDeleted bool) error {
|
||||
bm.assertLocked()
|
||||
|
||||
data = append([]byte{}, data...)
|
||||
bm.currentPackDataLength += len(data)
|
||||
shouldFinish := bm.currentPackDataLength >= bm.maxPackSize
|
||||
|
||||
@@ -754,8 +755,6 @@ func (bm *Manager) WriteBlock(ctx context.Context, data []byte, prefix string) (
|
||||
return blockID, nil
|
||||
}
|
||||
|
||||
data = append([]byte{}, data...)
|
||||
|
||||
err := bm.addToPackLocked(ctx, blockID, data, false)
|
||||
return blockID, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user