refactor: simplify signals; small optimizations

This commit is contained in:
Joao Goncalves
2025-11-16 19:53:51 -01:00
parent 2bb5d80502
commit 472351d9a5
6 changed files with 32 additions and 122 deletions

View File

@@ -153,9 +153,7 @@ func main() {
chat := currentRoom.GetData(func(c *Chat) Chat {
n := len(c.Entries)
start := n - 50
if start < 0 {
start = 0
}
start = max(start, 0)
trimmed := make([]ChatEntry, n-start)
copy(trimmed, c.Entries[start:])
out := *c