Changeset 2529
- Timestamp:
- 02/18/08 11:35:20 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/trunk-reorg/bknr/datastore/src/indices/category-index.lisp
r1112 r2529 142 142 (null key)) 143 143 (return-from index-add)) 144 (multiple-value-bind (value presentp) 145 (gethash key hash-table) 146 (if presentp 147 (push object (gethash key hash-table)) 148 (progn 149 (tree-add-category tree key) 150 (setf (gethash key hash-table) (list object))))))) 144 (if (nth-value 1 (gethash key hash-table)) 145 (push object (gethash key hash-table)) 146 (progn 147 (tree-add-category tree key) 148 (setf (gethash key hash-table) (list object)))))) 151 149 152 150 (defmethod index-remove ((index category-index) object) branches/trunk-reorg/bknr/datastore/src/indices/indices.lisp
r1565 r2529 136 136 (null key)) 137 137 (return-from index-add)) 138 (multiple-value-bind (value presentp) 139 (gethash key hash-table) 140 (if presentp 141 (push object (gethash key hash-table)) 142 (setf (gethash key hash-table) (list object)))))) 138 (if (nth-value 1 (gethash key hash-table)) 139 (push object (gethash key hash-table)) 140 (setf (gethash key hash-table) (list object))))) 143 141 144 142 (defmethod index-remove ((index hash-index) object) … … 173 171 (let ((key (class-name class)) 174 172 (hash-table (slot-index-hash-table index))) 175 (multiple-value-bind (value presentp) 176 (gethash key hash-table) 177 (if presentp 178 (push object (gethash key hash-table)) 179 (setf (gethash key hash-table) (list object))))))) 173 (if (nth-value 1 (gethash key hash-table)) 174 (push object (gethash key hash-table)) 175 (setf (gethash key hash-table) (list object)))))) 180 176 181 177 (if (class-index-index-superclasses index) … … 213 209 (hash-table (slot-index-hash-table index))) 214 210 (dolist (key keys) 215 (multiple-value-bind (value presentp) 216 (gethash key hash-table) 217 (if presentp 218 (push object (gethash key hash-table)) 219 (setf (gethash key hash-table) (list object))))))) 211 (if (nth-value 1 (gethash key hash-table)) 212 (push object (gethash key hash-table)) 213 (setf (gethash key hash-table) (list object)))))) 220 214 221 215 (defmethod index-remove ((index hash-list-index) object) … … 407 401 (let ((new-list (skip-list-index-skip-list new-index)) 408 402 (old-list (skip-list-index-skip-list old-index))) 409 (setf (skip-list-index-skip-list new- index) old-list)403 (setf (skip-list-index-skip-list new-list) old-list) 410 404 new-index)) 411 405 … … 420 414 (hash-table :accessor class-skip-index-hash-table))) 421 415 422 (defmethod initialize-instance :after ((index class-skip-index) &key (type 'string) 423 (test #'eql) 424 slots index-superclasses &allow-other-keys) 416 (defmethod initialize-instance :after ((index class-skip-index) 417 &key (test #'eql) slots index-superclasses) 425 418 (unless (<= (length slots) 1) 426 419 (error "Can not create slot-index with more than one slot."))
