diff options
author | iximeow <me@iximeow.net> | 2019-10-20 15:25:58 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2020-01-12 16:10:13 -0800 |
commit | 858315e264602b19fdde96800bd9d391cab2202a (patch) | |
tree | 4d0aaabe4b40ca3b9f90705f9b9400f885245af1 /src | |
parent | e5d46b89d95a0e1c1c3a7e112a9b36bb82163b2d (diff) |
that terrifying code is no longer an improvement
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2440,10 +2440,10 @@ pub fn read_instr<T: Iterator<Item=u8>>(mut bytes_iter: T, instruction: &mut Ins match bytes_iter.next() { Some(b) => { instruction.length += 1; - let record: u16 = (unsafe { std::mem::transmute::<&'static [OpcodeRecord], &'static [u16]>(&OPCODES[..]) })[b as usize]; - if let Interpretation::Instruction(opcode) = (unsafe { std::mem::transmute::<u16, OpcodeRecord>(record) }).0 { + let record = OPCODES[b as usize]; + if let Interpretation::Instruction(opcode) = record.0 { instruction.opcode = opcode; - break unsafe { std::mem::transmute::<u16, OpcodeRecord>(record) }; + break record; } else { match b { x if (x & 0xf0 == 0x40) => { |