From 1adac3869548f70ed21716164bd700aaa0e748a9 Mon Sep 17 00:00:00 2001 From: IncSW Date: Mon, 3 May 2021 13:43:05 +0300 Subject: [PATCH] remove extra dereference --- decode_slice.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/decode_slice.go b/decode_slice.go index b00a2bb..727caef 100644 --- a/decode_slice.go +++ b/decode_slice.go @@ -127,7 +127,7 @@ func (d *sliceDecoder) decodeStream(s *stream, depth int64, p unsafe.Pointer) er // assign new element to the slice typedmemmove(d.elemType, ep, unsafe_New(d.elemType)) } else if d.isElemPointerType { - **(**unsafe.Pointer)(unsafe.Pointer(&ep)) = nil // initialize elem pointer + *(*unsafe.Pointer)(ep) = nil // initialize elem pointer } if err := d.valueDecoder.decodeStream(s, depth, ep); err != nil { return err @@ -240,7 +240,7 @@ func (d *sliceDecoder) decode(buf []byte, cursor, depth int64, p unsafe.Pointer) // assign new element to the slice typedmemmove(d.elemType, ep, unsafe_New(d.elemType)) } else if d.isElemPointerType { - **(**unsafe.Pointer)(unsafe.Pointer(&ep)) = nil // initialize elem pointer + *(*unsafe.Pointer)(ep) = nil // initialize elem pointer } c, err := d.valueDecoder.decode(buf, cursor, depth, ep) if err != nil {