From 8e0c064ef49541672a598625155a4fec6f80777c Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 23 Jun 2020 16:21:51 +0200 Subject: prog: simplify execContext.write --- prog/encodingexec.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'prog/encodingexec.go') diff --git a/prog/encodingexec.go b/prog/encodingexec.go index 2295bb72e..e97ea610c 100644 --- a/prog/encodingexec.go +++ b/prog/encodingexec.go @@ -20,8 +20,6 @@ package prog import ( - "bytes" - "encoding/binary" "fmt" "sort" ) @@ -223,9 +221,7 @@ func (w *execContext) write(v uint64) { w.eof = true return } - buf := new(bytes.Buffer) - binary.Write(buf, HostEndian, v) - copy(w.buf, buf.Bytes()) + HostEndian.PutUint64(w.buf, v) w.buf = w.buf[8:] } -- cgit mrf-deployment