Przeglądaj źródła

More slotted classes

Joeri Exelmans 5 lat temu
rodzic
commit
d98becde8f

+ 2 - 1
src/sccd/controller/controller.py

@@ -11,9 +11,11 @@ from sccd.cd.cd import *
 # Threads, integration with existing event loop, game loop, test framework, ...
 # The Controller class itself is NOT thread-safe.
 class Controller:
+    __slots__ = ["cd", "object_manager", "queue", "simulated_time", "run_until"]
 
     @dataclasses.dataclass(eq=False, frozen=True)
     class EventQueueEntry:
+        __slots__ = ["event", "targets"]
         event: Event
         targets: List[Instance]
 
@@ -23,7 +25,6 @@ class Controller:
         self.queue: EventQueue[int, EventQueueEntry] = EventQueue()
 
         self.simulated_time = 0 # integer
-        self.initialized = False
 
         self.cd.globals.assert_ready()
 

+ 1 - 1
test/test_files/day_atlee/statechart_fig1_redialer.xml

@@ -14,7 +14,7 @@
 
     digit = func(i:int, pos:int) {
       result = i // 10**pos % 10;
-      log("digit " + int_to_str(pos) + " of " + int_to_str(i) + " is " + int_to_str(result));
+      # log("digit " + int_to_str(pos) + " of " + int_to_str(i) + " is " + int_to_str(result));
       return result;
     };