[gnus git] branch master updated: m0-11-202-g1d6b09c =1= Fix registry pruning routine

Eric <[email protected]> Wed, 01 Apr 2015 04:48:25 +0200
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  1d6b09cfca805e5becddda685a0340efd6034fda (commit)
      from  fbd6ec30603d7d417156eb0b721fd4719a88bb7e (commit)


- Log -----------------------------------------------------------------
commit 1d6b09cfca805e5becddda685a0340efd6034fda
Author: Eric Abrahamsen <[email protected]>
Date:   Mon Mar 30 15:12:40 2015 +0800

    Fix registry pruning routine
    
    * lisp/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.
    
    * lisp/ChangeLog:  Log.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 77573c6..7df3176 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2015-04-01  Eric Abrahamsen  <[email protected]>
+
+	* lisp/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  <[email protected]>
 
 	* plstore.el (plstore--decrypt): Clear entry in
diff --git a/lisp/registry.el b/lisp/registry.el
index c8d7d85..44c3358 100644
--- a/lisp/registry.el
+++ b/lisp/registry.el
@@ -361,11 +361,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)
+	(target-size
+	 (floor (- (oref db max-size)
 		   (* (oref db max-size)
-			   (oref db prune-factor))))
+		      (oref db prune-factor)))))
 	candidates)
-    (if (> size (oref db max-size))
+    (if (registry-full db)
 	(progn
 	  (setq candidates
 		(registry-collect-prune-candidates

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog   |    6 ++++++
 lisp/registry.el |    9 +++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project