*: use more efficient WriteBytes where appropriate

Before this patch on block import we could easily be spending more than 6
seconds out of 30 in Uint256 encoding for UnspentBalance, now it's completely
off the radar.
This commit is contained in:
Roman Khimov 2019-12-06 18:22:21 +03:00
parent e7687d620d
commit 844491d365
23 changed files with 40 additions and 40 deletions

View file

@ -19,7 +19,7 @@ func emit(w *io.BinWriter, instr opcode.Opcode, b []byte) {
// emitOpcode emits a single VM Instruction the given buffer.
func emitOpcode(w *io.BinWriter, instr opcode.Opcode) {
w.WriteLE(byte(instr))
w.WriteBytes([]byte{byte(instr)})
}
// emitBool emits a bool type the given buffer.