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

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

[nongnu] elpa/parseclj 30c950a4ad 167/185: Use map-contains-key


From: ELPA Syncer
Subject: [nongnu] elpa/parseclj 30c950a4ad 167/185: Use map-contains-key
Date: Tue, 28 Dec 2021 14:05:33 -0500 (EST)

branch: elpa/parseclj
commit 30c950a4ad42ada5f8b63045bc7567940f2f2987
Author: Arne Brasseur <arne@arnebrasseur.net>
Commit: Bozhidar Batsov <bozhidar@batsov.dev>

    Use map-contains-key
---
 parseclj.el | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/parseclj.el b/parseclj.el
index 3896c6b9ba..d10acaef4e 100644
--- a/parseclj.el
+++ b/parseclj.el
@@ -55,12 +55,10 @@ For example: (a-hash-table :foo 123 :bar 456)"
             kv-pairs)
     hash-map))
 
-(defun parseclj-alist-has-key? (coll k)
-  "Check if the given association list COLL has a certain key K."
-  (not (eq (map-elt coll k :not-found) :not-found)))
-
 (defun parseclj-alist-assoc (coll k v)
-  (if (parseclj-alist-has-key? coll k)
+  "Like parseclj-alist-assoc but actually works as advertised, not
+introducing duplicate keys"
+  (if (map-contains-key coll k)
       (mapcar (lambda (entry)
                 (if (equal (car entry) k)
                     (cons k v)



reply via email to

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