859a00c
Branches > main > 859a00c > files / src / net / bowmap / server / protocol
Pre-compute table partitions
Commit: 859a00ccc9e33a0019a3c6d8df32e55dd97a75ed
Parent: bce5890
2 changed files:
src/net/bowmap/server/protocol/readers.clj 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 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.