refactor: simplifying to ReadAt() and WriteAt()

This commit is contained in:
Chris Lu
2019-10-25 00:11:25 -07:00
parent 46ed2ca902
commit 7a51a9a582
2 changed files with 3 additions and 7 deletions

View File

@@ -154,7 +154,7 @@ func (n *Needle) Append(w *os.File, version Version) (offset uint64, size uint32
if exists {
mMap.WriteMemory(offset, uint64(len(bytesToWrite)), bytesToWrite)
} else {
_, err = w.Write(bytesToWrite)
_, err = w.WriteAt(bytesToWrite, int64(offset))
}
}