From 4e91b1c580ca248981313e6bc2c1a91683ebcc36 Mon Sep 17 00:00:00 2001 From: lwch Date: Mon, 23 Aug 2021 17:39:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=AC=E5=8F=91=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/client/pool/send.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/code/client/pool/send.go b/code/client/pool/send.go index cbee11a..3704b87 100644 --- a/code/client/pool/send.go +++ b/code/client/pool/send.go @@ -31,14 +31,11 @@ func (p *Pool) SendDisconnect(id, to string) { // SendData send forward data func (p *Pool) SendData(id, to string, data []byte) { - dup := func(data []byte) []byte { - ret := make([]byte, len(data)) - copy(ret, data) - return ret - } + dup := make([]byte, len(data)) + copy(dup, data) p.writeForward <- forwardData{ to: to, id: id, - data: dup(data), + data: dup, } }