one is kept."
(if (> (length list) 100)
(let ((hash (make-hash-table :test #'equal))
- res)
- (dolist (elt list)
- (unless (gethash elt hash)
- (puthash elt elt hash)
- (push elt res)))
- (setcdr list (cdr (nreverse res))))
+ (tail list)
+ elt retail)
+ (puthash (car list) t hash)
+ (while (setq retail (cdr tail))
+ (setq elt (car retail))
+ (if (gethash elt hash)
+ (setcdr tail (cdr retail))
+ (puthash elt t hash))
+ (setq tail retail)))
(let ((tail list))
(while tail
(setcdr tail (delete (car tail) (cdr tail)))