aboutsummaryrefslogtreecommitdiffstats
path: root/prog/encodingexec.go
diff options
context:
space:
mode:
Diffstat (limited to 'prog/encodingexec.go')
-rw-r--r--prog/encodingexec.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/prog/encodingexec.go b/prog/encodingexec.go
index 78eae81ae..2295bb72e 100644
--- a/prog/encodingexec.go
+++ b/prog/encodingexec.go
@@ -20,6 +20,8 @@
package prog
import (
+ "bytes"
+ "encoding/binary"
"fmt"
"sort"
)
@@ -221,14 +223,9 @@ func (w *execContext) write(v uint64) {
w.eof = true
return
}
- w.buf[0] = byte(v >> 0)
- w.buf[1] = byte(v >> 8)
- w.buf[2] = byte(v >> 16)
- w.buf[3] = byte(v >> 24)
- w.buf[4] = byte(v >> 32)
- w.buf[5] = byte(v >> 40)
- w.buf[6] = byte(v >> 48)
- w.buf[7] = byte(v >> 56)
+ buf := new(bytes.Buffer)
+ binary.Write(buf, HostEndian, v)
+ copy(w.buf, buf.Bytes())
w.buf = w.buf[8:]
}