From 9ff6d4e5cb915281365cadc079b709899a8bda9d Mon Sep 17 00:00:00 2001 From: thealmarty <“thealmartyblog@gmail.com”> Date: Tue, 30 Apr 2024 08:52:54 -0700 Subject: [PATCH] Fix update_byte. --- machine/src/core.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/machine/src/core.rs b/machine/src/core.rs index c0c25975..5253fd85 100644 --- a/machine/src/core.rs +++ b/machine/src/core.rs @@ -45,12 +45,7 @@ impl Word { // The cell is stored in little endian format in the compiler. But the VM stores it in big endian. impl Word { pub fn update_byte(self, byte: u8, loc: usize) -> Self { - let result_little_end: [u8; MEMORY_CELL_BYTES] = self.0; - let mut result = [0; 4]; - // Convert from little to big endian. - for i in 0..MEMORY_CELL_BYTES { - result[i] = result_little_end[3 - i]; - } + let mut result = self.0; result[loc] = byte; Self(result) }