* registry.el (registry-full): Fix logic.
[gnus] / lisp / registry.el
index 1a18dbd..d862e9d 100644 (file)
@@ -261,6 +261,11 @@ With assert non-nil, errors out if the key does not exist already."
          (remhash key data)))
       keys))
 
+  (defmethod registry-full ((db registry-db))
+    "Checks if registry-db THIS is full."
+    (>= (registry-size db)
+       (oref db :max-hard)))
+
   (defmethod registry-insert ((db registry-db) key entry)
     "Insert ENTRY under KEY into the registry-db THIS.
 Updates the secondary ('tracked') indices as well.
@@ -269,10 +274,9 @@ Errors out if the key exists already."
     (assert (not (gethash key (oref db :data))) nil
            "Key already exists in database")
 
-    (assert (< (registry-size db)
-              (oref db :max-hard))
+    (assert (registry-full db)
            nil
-           "max-hard size limit reached")
+           "registry max-hard size limit reached")
 
     ;; store the entry
     (puthash key entry (oref db :data))
@@ -298,7 +302,7 @@ Errors out if the key exists already."
             (when (and (< 0 expected)
                        (= 0 (mod count 1000)))
               (message "reindexing: %d of %d (%.2f%%)"
-                       count expected (/ (* 1000 count) expected)))
+                       count expected (/ (* 100 count) expected)))
             (dolist (val (cdr-safe (assq tr v)))
               (let* ((value-keys (registry-lookup-secondary-value db tr val)))
                 (push key value-keys)