mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
swarm/storage: simplify code
This commit is contained in:
parent
0219f32ba4
commit
cd83b4ecc3
1 changed files with 1 additions and 7 deletions
|
|
@ -402,7 +402,6 @@ func (r *LazyChunkReader) Size(ctx context.Context, quitC chan bool) (n int64, e
|
|||
|
||||
log.Debug("lazychunkreader.size", "addr", r.addr)
|
||||
if r.chunkData == nil {
|
||||
|
||||
startTime := time.Now()
|
||||
chunkData, err := r.getter.Get(cctx, Reference(r.addr))
|
||||
if err != nil {
|
||||
|
|
@ -411,13 +410,8 @@ func (r *LazyChunkReader) Size(ctx context.Context, quitC chan bool) (n int64, e
|
|||
}
|
||||
metrics.GetOrRegisterResettingTimer("lcr.getter.get", nil).UpdateSince(startTime)
|
||||
r.chunkData = chunkData
|
||||
s := r.chunkData.Size()
|
||||
log.Debug("lazychunkreader.size", "key", r.addr, "size", s)
|
||||
if s < 0 {
|
||||
return 0, errors.New("corrupt size")
|
||||
}
|
||||
return int64(s), nil
|
||||
}
|
||||
|
||||
s := r.chunkData.Size()
|
||||
log.Debug("lazychunkreader.size", "key", r.addr, "size", s)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue