Changeset 7957


Ignore:
Timestamp:
Dec 26, 2007, 8:04:55 AM (12 years ago)
Author:
gb
Message:

New hash-table iteration scheme.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/lib/hash.lisp

    r7741 r7957  
    211211
    212212
    213 (defun next-hash-table-iteration (state)
    214   (do* ((hash (nhti.hash-table state))
    215         (index (nhti.index state) (1+ index))
     213(defun next-hash-table-iteration-1 (state)
     214  (do* ((index (nhti.index state) (1+ index))
    216215        (keys (nhti.keys state))
    217         (nkeys (nhti.nkeys state))
    218         (missing (cons nil nil)))
     216        (values (nhti.values state))
     217        (nkeys (nhti.nkeys state)))
    219218       ((>= index nkeys)
    220219        (setf (nhti.index state) nkeys)
    221220        (values nil nil nil))
    222221    (declare (fixnum index nkeys)
    223              (simple-vector keys)
    224              (dynamic-extent missing))
     222             (simple-vector keys))
    225223    (let* ((key (svref keys index))
    226            (value (gethash key hash missing)))
    227       (unless (eq value missing)
     224           (value (svref values index)))
    228225        (setf (nhti.index state) (1+ index))
    229         (return (values t key value))))))
     226        (return (values t key value)))))
    230227
    231228
Note: See TracChangeset for help on using the changeset viewer.