mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-20 01:27:55 +08:00
docs: panicing
-> panicking
(#3687)
Signed-off-by: Ryan Russell <git@ryanrussell.org> Signed-off-by: Ryan Russell <git@ryanrussell.org>
This commit is contained in:
@@ -128,7 +128,7 @@ func (v *ChunkCacheVolume) getNeedleSlice(key types.NeedleId, offset, length uin
|
|||||||
}
|
}
|
||||||
wanted := min(int(length), int(nv.Size)-int(offset))
|
wanted := min(int(length), int(nv.Size)-int(offset))
|
||||||
if wanted < 0 {
|
if wanted < 0 {
|
||||||
// should never happen, but better than panicing
|
// should never happen, but better than panicking
|
||||||
return nil, ErrorOutOfBounds
|
return nil, ErrorOutOfBounds
|
||||||
}
|
}
|
||||||
data := make([]byte, wanted)
|
data := make([]byte, wanted)
|
||||||
@@ -151,7 +151,7 @@ func (v *ChunkCacheVolume) readNeedleSliceAt(data []byte, key types.NeedleId, of
|
|||||||
}
|
}
|
||||||
wanted := min(len(data), int(nv.Size)-int(offset))
|
wanted := min(len(data), int(nv.Size)-int(offset))
|
||||||
if wanted < 0 {
|
if wanted < 0 {
|
||||||
// should never happen, but better than panicing
|
// should never happen, but better than panicking
|
||||||
return 0, ErrorOutOfBounds
|
return 0, ErrorOutOfBounds
|
||||||
}
|
}
|
||||||
if n, err = v.DataBackend.ReadAt(data, nv.Offset.ToActualOffset()+int64(offset)); err != nil {
|
if n, err = v.DataBackend.ReadAt(data, nv.Offset.ToActualOffset()+int64(offset)); err != nil {
|
||||||
|
Reference in New Issue
Block a user