From fdae736f2217df294f190f272bc0cd6eeb3c405b Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Wed, 30 Mar 2022 16:29:47 -0500 Subject: [PATCH] Remove unneeded copy --- modules/activitypub/client.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/activitypub/client.go b/modules/activitypub/client.go index 0720909126..9cd9f0dc38 100644 --- a/modules/activitypub/client.go +++ b/modules/activitypub/client.go @@ -100,9 +100,7 @@ func NewClient(user *user_model.User, pubID string) (c *Client, err error) { // NewRequest function func (c *Client) NewRequest(b []byte, to string) (req *http.Request, err error) { - byteCopy := make([]byte, len(b)) - copy(byteCopy, b) - buf := bytes.NewBuffer(byteCopy) + buf := bytes.NewBuffer(b) req, err = http.NewRequest(http.MethodPost, to, buf) if err != nil { return