mirror of
https://github.com/yggdrasil-network/yggdrasil-go
synced 2024-11-10 07:20:39 +03:00
minor allocation fix
This commit is contained in:
parent
6cb0ed91ad
commit
d795ab1b65
@ -44,6 +44,7 @@ func (s *stream) writeMsg(bs []byte) (int, error) {
|
||||
padLen := len(buf[0]) + len(buf[1])
|
||||
buf = append(buf, bs)
|
||||
totalLen := padLen + len(bs)
|
||||
s.outputBuffer = buf[:0] // So we can reuse the same underlying array later
|
||||
var bn int
|
||||
for bn < totalLen {
|
||||
n, err := buf.WriteTo(s.rwc)
|
||||
|
Loading…
Reference in New Issue
Block a user