summaryrefslogtreecommitdiff
path: root/server/lib/core/state
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2026-11-23 20:02:33 +0100
committerJoel Klinghed <the_jk@spawned.biz>2026-11-23 20:02:33 +0100
commitc6c2ebfcd2bf6d30732ba9bbb0a4524a76bcbf05 (patch)
tree32af5b8e4ced68b8052659632e5ab64ab4e3758e /server/lib/core/state
parent3346626cdcbf37cd63428e5f537fa5c70c71425a (diff)
server: use a for loop in notifyListeners instead of forEach
Diffstat (limited to 'server/lib/core/state')
-rw-r--r--server/lib/core/state/game_state.dart6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/lib/core/state/game_state.dart b/server/lib/core/state/game_state.dart
index 4b2ff0e..903cc51 100644
--- a/server/lib/core/state/game_state.dart
+++ b/server/lib/core/state/game_state.dart
@@ -168,7 +168,11 @@ class GameState {
final List<void Function()> _listeners = [];
void addListener(void Function() listener) => _listeners.add(listener);
void removeListener(void Function() listener) => _listeners.remove(listener);
- void notifyListeners() => [..._listeners].forEach((l) => l());
+ void notifyListeners() {
+ for (final listener in [..._listeners]) {
+ listener();
+ }
+ }
void init() {
_elementState[Elements.fire] = ElementState.inert;