mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-01-18 14:41:31 +08:00
a little more concise
This commit is contained in:
parent
81debd73d4
commit
8f0b527b28
@ -220,16 +220,15 @@ func (v *Volume) delete(n *Needle) (uint32, error) {
|
||||
nv, ok := v.nm.Get(n.Id)
|
||||
//fmt.Println("key", n.Id, "volume offset", nv.Offset, "data_size", n.Size, "cached size", nv.Size)
|
||||
if ok {
|
||||
var err error
|
||||
size := nv.Size
|
||||
if err = v.nm.Delete(n.Id); err != nil {
|
||||
if err:= v.nm.Delete(n.Id); err != nil {
|
||||
return size, err
|
||||
}
|
||||
if _, err = v.dataFile.Seek(0, 2); err != nil {
|
||||
if _, err:= v.dataFile.Seek(0, 2); err != nil {
|
||||
return size, err
|
||||
}
|
||||
n.Data = make([]byte, 0)
|
||||
_, err = n.Append(v.dataFile, v.Version())
|
||||
_, err := n.Append(v.dataFile, v.Version())
|
||||
return size, err
|
||||
}
|
||||
return 0, nil
|
||||
|
Loading…
Reference in New Issue
Block a user