rm push/pop

This commit is contained in:
2026-02-26 08:13:27 -06:00
parent ef7e3e6449
commit ce6b0ddb3a
31 changed files with 251 additions and 255 deletions

View File

@@ -93,13 +93,13 @@ function create_user(index, config) {
// Push entity onto control stack
push: function(entity) {
push(this.control_stack, entity)
this.control_stack[] = entity
},
// Pop from control stack
pop: function() {
if (length(this.control_stack) > 1) {
return pop(this.control_stack)
return this.control_stack[]
}
return null
},
@@ -169,7 +169,7 @@ function pick_user(canon) {
picked.active_device = canon.device_id
if (find(picked.paired_devices, canon.device_id) == null) {
push(picked.paired_devices, canon.device_id)
picked.paired_devices[] = canon.device_id
}
}
}
@@ -211,7 +211,7 @@ function configure(o) {
// Create users
_users = []
for (i = 0; i < _config.max_users; i++) {
push(_users, create_user(i, _config))
_users[] = create_user(i, _config)
}
_initialized = true
@@ -268,7 +268,7 @@ function snapshot() {
for (i = 0; i < length(_users); i++) {
u = _users[i]
target = u.target()
push(users, {
users[] = {
index: u.index,
device_kind: u.device_kind(),
active_device: u.active_device,
@@ -276,7 +276,7 @@ function snapshot() {
down: u.down(),
control_stack_depth: length(u.control_stack),
target: target ? (target.name || '(entity)') : null
})
}
}
return {
max_users: _config.max_users,