mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
shortcut for empty file
This commit is contained in:
parent
88849b9807
commit
badd8fdf8f
|
@ -145,6 +145,9 @@ func (v *Volume) readNeedle(n *Needle) (int, error) {
|
|||
if nv.Size == TombstoneFileSize {
|
||||
return -1, errors.New("already deleted")
|
||||
}
|
||||
if nv.Size == 0 {
|
||||
return 0, nil
|
||||
}
|
||||
err := n.ReadData(v.dataFile, int64(nv.Offset)*NeedlePaddingSize, nv.Size, v.Version())
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
|
Loading…
Reference in a new issue