mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 22:41:06 -08:00
Check if 'hash-table-contains-p' is available in map.el
* lisp/emacs-lisp/map.el (map-contains-key): Hide old
implementation prior to f60fc128 behind a `fboundp', as the
package is distributed on ELPA and should be backwards
compatible to Emacs 26. (Bug#79711)
This commit is contained in:
parent
fbb7eb5686
commit
3dacd8b41a
1 changed files with 5 additions and 1 deletions
|
|
@ -405,7 +405,11 @@ If MAP is a plist, TESTFN defaults to `eq'."
|
|||
|
||||
(cl-defmethod map-contains-key ((map hash-table) key &optional _testfn)
|
||||
"Return non-nil if MAP contains KEY, ignoring TESTFN."
|
||||
(hash-table-contains-p key map))
|
||||
;; FIXME: use `hash-table-contains-p' from Compat when available.
|
||||
(if (fboundp 'hash-table-contains-p)
|
||||
(hash-table-contains-p key map)
|
||||
(let ((v '(nil)))
|
||||
(not (eq v (gethash key map v))))))
|
||||
|
||||
(cl-defgeneric map-some (pred map)
|
||||
"Return the first non-nil value from applying PRED to elements of MAP.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue