Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swarm: remove unused/dead code #18351

Merged
merged 4 commits into from
Dec 23, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
swarm/storage: simplify code
nonsense committed Dec 13, 2018
commit cd83b4ecc330be893cbd9d7ba47a5c894bc97c93
8 changes: 1 addition & 7 deletions swarm/storage/chunker.go
Original file line number Diff line number Diff line change
@@ -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)