From a75b5e9d930a234a6ddf7e78ba05f0962079946e Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Sat, 6 Feb 2021 17:41:51 +0900 Subject: [PATCH] optimize unnecessary copy --- decode_string.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/decode_string.go b/decode_string.go index 66412c9..3847265 100644 --- a/decode_string.go +++ b/decode_string.go @@ -35,7 +35,7 @@ func (d *stringDecoder) decodeStream(s *stream, p unsafe.Pointer) error { if err != nil { return err } - *(*string)(p) = string(bytes) + *(*string)(p) = *(*string)(unsafe.Pointer(&bytes)) s.reset() return nil }