emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ebdb dbd3559 042/350: Do away with ebdb-seen-uuids


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb dbd3559 042/350: Do away with ebdb-seen-uuids
Date: Mon, 14 Aug 2017 11:45:59 -0400 (EDT)

branch: externals/ebdb
commit dbd3559c962129cdd3cd83f16aca47a3f191d765
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Do away with ebdb-seen-uuids
    
    Now that we're hashing uuids in the load process, this variable isn't
    necessary at all.
    
    * ebdb.el (ebdb-delete-record): Don't need to remove the uuid here.
      (ebdb-check-uuid): Just use the hashtable.
      (ebdb-clear-vars): Remove from variables that need to be cleared.
---
 ebdb.el | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/ebdb.el b/ebdb.el
index 2846f26..89e29d5 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -76,9 +76,6 @@
 (defvar ebdb-record-tracker nil
   "A list of all the loaded records")
 
-(defvar ebdb-seen-uuids nil
-  "A list of all previously-loaded UUIDs.")
-
 (defvar ebdb-hashtable (make-hash-table :test 'equal)
   "Hash table for EBDB records.
 Hashes the fields first-last-name, last-first-name, organization, aka,
@@ -1752,8 +1749,6 @@ altogether.")
     (unless db
       (dolist (db dbs)
        (ebdb-db-remove-record db record)))
-    (setq ebdb-seen-uuids
-         (delete uuid ebdb-seen-uuids))
     (dolist (field (slot-value record 'fields))
       (ebdb-delete-field field record unload))
     (ebdb-remhash uuid record)
@@ -2609,9 +2604,10 @@ instances to add as part of the role."
 (defun ebdb-check-uuid (uuid)
   "Ensure that UUID hasn't been seen before.  If it has, raise an
 error containing the record that already has that uuid."
-  (when (member uuid ebdb-seen-uuids)
-    (signal 'ebdb-duplicate-uuid
-           (list (ebdb-gethash uuid 'uuid)))))
+  (let ((dup (ebdb-gethash uuid 'uuid)))
+    (when dup
+      (signal 'ebdb-duplicate-uuid
+             (list dup)))))
 
 (defun ebdb-make-uuid (&optional prefix)
   "Create and return a new UUID.
@@ -3155,8 +3151,7 @@ the persistent save, or allow them to propagate."
 (defun ebdb-clear-vars ()
   "Set all internal EBDB vars to nil."
   (setq ebdb-db-list nil
-       ebdb-record-tracker nil
-       ebdb-seen-uuids nil)
+       ebdb-record-tracker nil)
   (clrhash ebdb-org-hashtable)
   (clrhash ebdb-hashtable))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]