From 86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32 Mon Sep 17 00:00:00 2001 From: Emil Date: Fri, 14 Sep 2018 23:07:13 +0300 Subject: all: simplify s[:] to s where s is a slice (#17673) --- eth/tracers/tracer.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'eth') 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) -- cgit