refactor(bytecode): coalesce an annoying match duplicate

This commit is contained in:
Alain Zscheile 2022-10-23 00:56:46 +02:00
parent 7e7fae3769
commit bdc42a3fae

View file

@ -128,9 +128,9 @@ impl Instr {
writer.write_all(&self.typ().int_value().to_be_bytes())?;
match self {
Instr::CallRemote(val) => writer.write_all(&val.to_be_bytes()),
Instr::CallLocal(val) => writer.write_all(&val.to_be_bytes()),
Instr::CallLDefer(val) => writer.write_all(&val.to_be_bytes()),
Instr::JumpCond(val) => writer.write_all(&val.to_be_bytes()),
Instr::CallLocal(val) | Instr::CallLDefer | Instr::JumpCond => {
writer.write_all(&val.to_be_bytes())
}
Instr::Push(val) => writer.write_all(&val.to_be_bytes()),
Instr::Pop(val) | Instr::Dup(val) | Instr::Swap(val) => {
writer.write_all(&val.to_be_bytes())