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

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

[nongnu] elpa/hyperdrive 0712c733c5 04/10: Change: (h/by-slot) Use cl-st


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 0712c733c5 04/10: Change: (h/by-slot) Use cl-struct-slot-value
Date: Sat, 2 Dec 2023 22:00:07 -0500 (EST)

branch: elpa/hyperdrive
commit 0712c733c5e8f6a137ae07dfa3df02ab3452b4a4
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Change: (h/by-slot) Use cl-struct-slot-value
---
 hyperdrive-lib.el | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index af57d317da..3064e7881a 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -1271,16 +1271,12 @@ Otherwise, return nil.  SLOT may be one of
 - seed
 - petname
 - public-key"
-  (let ((accessor-function (pcase-exhaustive slot
-                             ('seed #'h/seed)
-                             ('petname #'h/petname)
-                             ('public-key #'h/public-key))))
-    (catch 'get-first-hash
-      (maphash (lambda (_key val)
-                 (when (equal (funcall accessor-function val) value)
-                   (throw 'get-first-hash val)))
-               h/hyperdrives)
-      nil)))
+  (catch 'get-first-hash
+    (maphash (lambda (_key val)
+               (when (equal (cl-struct-slot-value 'hyperdrive slot val) value)
+                 (throw 'get-first-hash val)))
+             h/hyperdrives)
+    nil))
 
 ;;;; Handlers
 



reply via email to

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