From 950612544b738391ebdd80309196d49a340e9f1c Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Thu, 16 Aug 2018 12:40:55 +0200 Subject: [PATCH] simple write for single buffer --- common/buf/writer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/buf/writer.go b/common/buf/writer.go index cb48691bc..49c112ef4 100644 --- a/common/buf/writer.go +++ b/common/buf/writer.go @@ -21,6 +21,10 @@ func (w *BufferToBytesWriter) WriteMultiBuffer(mb MultiBuffer) error { return nil } + if len(mb) == 1 { + return WriteAllBytes(w.Writer, mb[0].Bytes()) + } + bs := mb.ToNetBuffers() for size > 0 {