859a00c

Bowmap · bowmap.git · Tickets

Branches > main > 859a00c > files / src / net / bowmap / server / protocol

Pre-compute table partitions

Grahp, 2026-09-24

Commit: 859a00ccc9e33a0019a3c6d8df32e55dd97a75ed
Parent: bce5890

2 changed files:

src/net/bowmap/server/protocol/readers.clj modified (view file)

@@ -46,10 +46,11 @@     (m (reader buf))))  (defn table< [table]-  (fn [buf]-    (reduce (fn [acc [field reader]]-              (assoc-some acc field (reader buf)))-            {} (partition 2 table))))+  (let [t (partition 2 table)]+    (fn [buf]+      (reduce (fn [acc [field reader]]+                (assoc-some acc field (reader buf)))+              {} t))))  (defn ->reader   "Attempts to coerces 'x' into a reader. Throws if it cannot.

src/net/bowmap/server/protocol/writers.clj modified (view file)

@@ -53,10 +53,11 @@                                                                         :online online-player-count}))))  (defn table> [table]-  (fn [buf m]-    (reduce (fn [acc [field writer]]-              (writer acc (get m field)))-            buf (partition 2 table))))+  (let [t (partition 2 table)]+    (fn [buf m]+      (reduce (fn [acc [field writer]]+                (writer acc (get m field)))+              buf t))))  (defn ->writer   "Attempts to coerces 'x' into a writer. Throws if it cannot.