Remove unecessary copy

This commit is contained in:
Carlos Martín Nieto 2016-08-27 20:47:41 +02:00
parent 3c1ba8c40e
commit b5d213c2c1
1 changed files with 2 additions and 4 deletions

View File

@ -28,16 +28,14 @@ func TestCreateBlobFromBuffer(t *testing.T) {
}
for _, data := range []([]byte){[]byte("hello there"), doublePointerBytes()} {
expected := make([]byte, len(data))
copy(expected, data)
id, err = repo.CreateBlobFromBuffer(data)
checkFatal(t, err)
blob, err := repo.LookupBlob(id)
checkFatal(t, err)
if !bytes.Equal(blob.Contents(), expected) {
if !bytes.Equal(blob.Contents(), data) {
t.Fatal("Loaded bytes don't match original bytes:",
blob.Contents(), "!=", expected)
blob.Contents(), "!=", data)
}
}
}