Changeset 7738


Ignore:
Timestamp:
09/19/04 13:35:21 (17 years ago)
Author:
piso
Message:

Make sure size > 0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/make-hash-table.lisp

    r5308 r7738  
    11;;; make-hash-table.lisp
    22;;;
    3 ;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: make-hash-table.lisp,v 1.4 2004-01-01 18:24:03 piso Exp $
     3;;; Copyright (C) 2003-2004 Peter Graves
     4;;; $Id: make-hash-table.lisp,v 1.5 2004-09-19 13:35:21 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    1818;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    1919
    20 (in-package "SYSTEM")
     20(in-package #:system)
    2121
    2222(defun make-hash-table (&key (test 'eql) (size 11) (rehash-size 1.5)
     
    2424  (setq test (coerce-to-function test))
    2525  (unless (and (integerp size) (>= size 0))
    26     (error 'type-error "MAKE-HASH-TABLE: ~S is not a non-negative integer" size))
    27   ;; %make-hash-table expects size to be a fixnum.
    28   (when (> size array-dimension-limit)
    29     (setq size array-dimension-limit))
    30   (%make-hash-table test size rehash-size rehash-threshold))
     26    (error 'type-error "MAKE-HASH-TABLE: ~S is not a non-negative integer." size))
     27  (let ((size (max 11 (min size array-dimension-limit))))
     28    (%make-hash-table test size rehash-size rehash-threshold)))
Note: See TracChangeset for help on using the changeset viewer.