/[cmucl]/src/code/hash.lisp
ViewVC logotype

Diff of /src/code/hash.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by wlott, Sat Dec 14 08:57:25 1991 UTC revision 1.11 by wlott, Sat Dec 14 13:09:37 1991 UTC
# Line 234  Line 234 
234    (declare (type (or function (member eq eql equal)) test)    (declare (type (or function (member eq eql equal)) test)
235             (type index size rehash-size)             (type index size rehash-size)
236             (type (or (float 0.0 1.0) index) rehash-threshold))             (type (or (float 0.0 1.0) index) rehash-threshold))
237    (let ((test (cond ((or (eq test #'eq) (eq test 'eq)) 'eq)    (let* ((test (cond ((or (eq test #'eq) (eq test 'eq)) 'eq)
238                      ((or (eq test #'eql) (eq test 'eql)) 'eql)                       ((or (eq test #'eql) (eq test 'eql)) 'eql)
239                      ((or (eq test #'equal) (eq test 'equal)) 'equal)                       ((or (eq test #'equal) (eq test 'equal)) 'equal)
240                      (t                       (t
241                       (error "~S is an illegal :Test for hash tables." test))))                        (error "~S is an illegal :Test for hash tables." test))))
242          (size (if (<= size 37) 37 (almost-primify size)))           (size (if (<= size 37) 37 (almost-primify size)))
243          (rehash-threshold           (rehash-threshold
244           (cond ((and (fixnump rehash-threshold)            (cond ((and (fixnump rehash-threshold)
245                       (<= 0 rehash-threshold size))                        (<= 0 rehash-threshold size))
246                  rehash-threshold)                   rehash-threshold)
247                 ((and (floatp rehash-threshold)                  ((and (floatp rehash-threshold)
248                       (<= 0.0 rehash-threshold 1.0))                        (<= 0.0 rehash-threshold 1.0))
249                  (ceiling (* rehash-threshold size)))                   (ceiling (* rehash-threshold size)))
250                 (t                  (t
251                  (error "Invalid rehash-threshold: ~S.~%Must be either a float ~                   (error "Invalid rehash-threshold: ~S.~%Must be either a float ~
252                          between 0.0 and 1.0 ~%or an integer between 0 and ~D."                           between 0.0 and 1.0 ~%or an integer between 0 and ~D."
253                         rehash-threshold                          rehash-threshold
254                         size))))                          size))))
255          (table (make-array size :initial-element nil)))           (table (make-array size :initial-element nil)))
256      (make-hash-table-structure :size size      (make-hash-table-structure :size size
257                                 :rehash-size rehash-size                                 :rehash-size rehash-size
258                                 :rehash-threshold rehash-threshold                                 :rehash-threshold rehash-threshold

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.5