diff options
author | Emil <mursalimovemeel@gmail.com> | 2018-09-15 04:07:13 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-09-15 04:07:13 +0800 |
commit | 86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32 (patch) | |
tree | 92ee61a4d5a2c750b6abc257f30b040485e29842 /eth | |
parent | 7bb95a9a64c9d26bef4f15fdd9301bb0b5cdb668 (diff) | |
download | dexon-86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32.tar.gz dexon-86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32.tar.zst dexon-86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32.zip |
all: simplify s[:] to s where s is a slice (#17673)
Diffstat (limited to 'eth')
-rw-r--r-- | eth/tracers/tracer.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/eth/tracers/tracer.go b/eth/tracers/tracer.go index feb57e060..b519236f2 100644 --- a/eth/tracers/tracer.go +++ b/eth/tracers/tracer.go @@ -124,7 +124,7 @@ func (mw *memoryWrapper) pushObject(vm *duktape.Context) { ctx.Pop2() ptr := ctx.PushFixedBuffer(len(blob)) - copy(makeSlice(ptr, uint(len(blob))), blob[:]) + copy(makeSlice(ptr, uint(len(blob))), blob) return 1 }) vm.PutPropString(obj, "slice") @@ -204,7 +204,7 @@ func (dw *dbWrapper) pushObject(vm *duktape.Context) { code := dw.db.GetCode(common.BytesToAddress(popSlice(ctx))) ptr := ctx.PushFixedBuffer(len(code)) - copy(makeSlice(ptr, uint(len(code))), code[:]) + copy(makeSlice(ptr, uint(len(code))), code) return 1 }) vm.PutPropString(obj, "getCode") @@ -268,7 +268,7 @@ func (cw *contractWrapper) pushObject(vm *duktape.Context) { blob := cw.contract.Input ptr := ctx.PushFixedBuffer(len(blob)) - copy(makeSlice(ptr, uint(len(blob))), blob[:]) + copy(makeSlice(ptr, uint(len(blob))), blob) return 1 }) vm.PutPropString(obj, "getInput") @@ -584,7 +584,7 @@ func (jst *Tracer) GetResult() (json.RawMessage, error) { case []byte: ptr := jst.vm.PushFixedBuffer(len(val)) - copy(makeSlice(ptr, uint(len(val))), val[:]) + copy(makeSlice(ptr, uint(len(val))), val) case common.Address: ptr := jst.vm.PushFixedBuffer(20) |