[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/gnus/gnus-registry.el [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/gnus/gnus-registry.el [lexbind] |
Date: |
Wed, 15 Sep 2004 20:38:51 -0400 |
Index: emacs/lisp/gnus/gnus-registry.el
diff -c emacs/lisp/gnus/gnus-registry.el:1.3.2.1
emacs/lisp/gnus/gnus-registry.el:1.3.2.2
*** emacs/lisp/gnus/gnus-registry.el:1.3.2.1 Thu Sep 16 00:12:15 2004
--- emacs/lisp/gnus/gnus-registry.el Thu Sep 16 00:14:56 2004
***************
*** 266,290 ****
(defun gnus-registry-trim (alist)
"Trim alist to size, using gnus-registry-max-entries."
(if (null gnus-registry-max-entries)
! alist ; just return the alist
;; else, when given max-entries, trim the alist
! (let ((timehash (make-hash-table
! :size 4096
! :test 'equal)))
(maphash
(lambda (key value)
! (puthash key (gnus-registry-fetch-extra key 'mtime) timehash))
gnus-registry-hashtb)
;; we use the return value of this setq, which is the trimmed alist
(setq alist
! (nthcdr
! (- (length alist) gnus-registry-max-entries)
! (sort alist
! (lambda (a b)
! (time-less-p
! (cdr (gethash (car a) timehash))
! (cdr (gethash (car b) timehash))))))))))
(defun alist-to-hashtable (alist)
"Build a hashtable from the values in ALIST."
--- 266,292 ----
(defun gnus-registry-trim (alist)
"Trim alist to size, using gnus-registry-max-entries."
(if (null gnus-registry-max-entries)
! alist ; just return the alist
;; else, when given max-entries, trim the alist
! (let* ((timehash (make-hash-table
! :size 4096
! :test 'equal))
! (trim-length (- (length alist) gnus-registry-max-entries))
! (trim-length (if (natnump trim-length) trim-length 0)))
(maphash
(lambda (key value)
! (puthash key (gnus-registry-fetch-extra key 'mtime) timehash))
gnus-registry-hashtb)
;; we use the return value of this setq, which is the trimmed alist
(setq alist
! (nthcdr
! trim-length
! (sort alist
! (lambda (a b)
! (time-less-p
! (cdr (gethash (car a) timehash))
! (cdr (gethash (car b) timehash))))))))))
(defun alist-to-hashtable (alist)
"Build a hashtable from the values in ALIST."