|
|
@ -1,6 +1,7 @@ |
|
|
|
package storage |
|
|
|
|
|
|
|
import ( |
|
|
|
"bytes" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"io" |
|
|
@ -166,13 +167,7 @@ func (v *Volume) isFileUnchanged(n *Needle) bool { |
|
|
|
} |
|
|
|
oldNeedle := new(Needle) |
|
|
|
oldNeedle.Read(v.dataFile, nv.Size, v.Version()) |
|
|
|
if len(oldNeedle.Data) == len(n.Data) && oldNeedle.Checksum == n.Checksum { |
|
|
|
length := len(n.Data) |
|
|
|
for i := 0; i < length; i++ { |
|
|
|
if n.Data[i] != oldNeedle.Data[i] { |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
if oldNeedle.Checksum == n.Checksum && bytes.Equal(oldNeedle.Data, n.Data) { |
|
|
|
n.Size = oldNeedle.Size |
|
|
|
return true |
|
|
|
} |
|
|
|