2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-02 19:49:44 +00:00

repository: Use ReadAt() instead of Load()

This commit is contained in:
Alexander Neumann 2017-01-23 17:06:41 +01:00
parent e8fcc7e74c
commit f382696ccf

View File

@ -97,7 +97,8 @@ func (r *Repository) loadBlob(id restic.ID, t restic.BlobType, plaintextBuf []by
// load blob from pack // load blob from pack
h := restic.Handle{Type: restic.DataFile, Name: blob.PackID.String()} h := restic.Handle{Type: restic.DataFile, Name: blob.PackID.String()}
plaintextBuf = plaintextBuf[:cap(plaintextBuf)] plaintextBuf = plaintextBuf[:cap(plaintextBuf)]
n, err := r.be.Load(h, plaintextBuf, int64(blob.Offset))
n, err := restic.ReadAt(r.be, h, int64(blob.Offset), plaintextBuf)
if err != nil { if err != nil {
debug.Log("error loading blob %v: %v", blob, err) debug.Log("error loading blob %v: %v", blob, err)
lastError = err lastError = err