diff --git a/s48/hawk-dns-server/db.scm b/s48/hawk-dns-server/db.scm index adda6a0..de3e26e 100644 --- a/s48/hawk-dns-server/db.scm +++ b/s48/hawk-dns-server/db.scm @@ -28,13 +28,7 @@ )) (define (lookup key) - (let ((*result #f)) - (do ((i 0 (+ i 1))) - ((eq? i (length *db)) - *result) - (if (eq? key (car (list-ref *db i))) - (set! *result (cadr (list-ref *db i)))) - ))) + (cadr (list-ref *db (key->hash key)))) (define (key->hash key) (let ((*hash 0)) diff --git a/s48/hawk-dns-server/db.scm~ b/s48/hawk-dns-server/db.scm~ index adda6a0..aa72079 100644 --- a/s48/hawk-dns-server/db.scm~ +++ b/s48/hawk-dns-server/db.scm~ @@ -28,13 +28,7 @@ )) (define (lookup key) - (let ((*result #f)) - (do ((i 0 (+ i 1))) - ((eq? i (length *db)) - *result) - (if (eq? key (car (list-ref *db i))) - (set! *result (cadr (list-ref *db i)))) - ))) + (cadr (list-ref *db (key->hash key))) (define (key->hash key) (let ((*hash 0))