diff --git a/bitutilities.py b/bitutilities.py index 064ed3b..ff9adbe 100644 --- a/bitutilities.py +++ b/bitutilities.py @@ -15,8 +15,7 @@ class BasicRegister: return f"Memory: {[int(value) for value in self.memory]}" def reverse(self): - for i, value in enumerate(self.memory): - self.memory[i] = not value + self.memory = deque([not value for value in self.memory]) def left_shift(self, digit_to_fill: bool = False, steps_shifted: int = 1) -> deque[bool]: self.memory.extend([digit_to_fill] * steps_shifted)