~edwargix/tallyard

dc93a7fc73f78ffcdca9997572919bd3bba42d5b — David Florness 5 years ago 9fa7f18
Wrap the results function in a contract
1 files changed, 3 insertions(+), 1 deletions(-)

M server.rkt
M server.rkt => server.rkt +3 -1
@@ 60,7 60,9 @@
   200 #f (current-seconds) #"application/octet-stream"
   empty (list (integer->bytes n (/ keylen 8) #f))))

(define (results votes)
(define/contract (results votes)
  (-> (listof (listof (integer-in 0 (sub1 (length cands)))))
      (listof (integer-in 0 (sub1 (length cands)))))
  (let res ([votes votes]
            [firsts (make-immutable-hash
                     (for/list ([i (in-range (length cands))])