aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/manager.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/casino/manager.go')
-rw-r--r--internal/casino/manager.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/casino/manager.go b/internal/casino/manager.go
index b71e5df..d9b2c3e 100644
--- a/internal/casino/manager.go
+++ b/internal/casino/manager.go
@@ -75,9 +75,9 @@ func (m *Manager) EnsureMachine(roomID int, cfg MachineConfig) *Machine {
m.mu.Lock()
defer m.mu.Unlock()
if machine := m.machines[key]; machine != nil {
- // DeepEqual (not ==) so the *bool rule fields compare by value;
- // == would treat every freshly parsed config as different and
- // discard an idle machine on every room load.
+ // DeepEqual (not ==) compares the config by value and stays correct
+ // as rule structs gain pointer/slice fields; == would panic or, for
+ // a struct with incomparable fields, fail to compile.
if reflect.DeepEqual(machine.Config, cfg) {
return machine
}