]> git.eshelyaron.com Git - emacs.git/commitdiff
lisp/gnus/registry.el (registry-prune): Fix registry pruning routine
authorEric Abrahamsen <eric@ericabrahamsen.net>
Wed, 1 Apr 2015 04:55:34 +0000 (04:55 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 1 Apr 2015 04:55:34 +0000 (04:55 +0000)
lisp/gnus/ChangeLog
lisp/gnus/registry.el

index 5b10d45e8140f15f5d84536266fa7be72cd1c3e8..95ead23cb51fe2a7bd0ed6a758d7db4743293f14 100644 (file)
@@ -1,3 +1,9 @@
+2015-04-01  Eric Abrahamsen  <eric@ericabrahamsen.net>
+
+       * registry.el (registry-prune): Re-use `registry-full' in
+       `registry-prune'.  It's a bit of redundant work, but safer.
+       Also ensure that target-size is an integer.
+
 2015-03-31  Daiki Ueno  <ueno@gnu.org>
 
        * plstore.el (plstore--decrypt): Clear entry in
index e4ba0bc547f5dd8f7d46187945f6fedcdd65cf86..96a89fca1b707cbcc9ce938e3657bec1b1ffee2b 100644 (file)
@@ -341,11 +341,12 @@ from the front of the list are deleted first.
 
 Returns the number of deleted entries."
   (let ((size (registry-size db))
-       (target-size (- (oref db max-size)
-                       (* (oref db max-size)
-                          (oref db prune-factor))))
+       (target-size
+        (floor (- (oref db max-size)
+                  (* (oref db max-size)
+                     (oref db prune-factor)))))
        candidates)
-    (if (> size (oref db max-size))
+    (if (registry-full db)
        (progn
          (setq candidates
                (registry-collect-prune-candidates