diff options
author | Tino Calancha <tino.calancha@gmail.com> | 2016-11-26 12:03:25 +0900 |
---|---|---|
committer | Tino Calancha <tino.calancha@gmail.com> | 2016-11-26 12:03:25 +0900 |
commit | acb5589fcd981650225e9fb2e949e3681db551c1 (patch) | |
tree | 9372464e702b4ba56d2ff7ecd109c2319b9234bb /lisp/emacs-lisp | |
parent | 8e5c0259796a5bb9e97aefdb6a431551aff6a253 (diff) | |
download | emacs-acb5589fcd981650225e9fb2e949e3681db551c1.tar.gz emacs-acb5589fcd981650225e9fb2e949e3681db551c1.tar.bz2 emacs-acb5589fcd981650225e9fb2e949e3681db551c1.zip |
* lisp/emacs-lisp/subr-x.el (hash-table-keys, hash-table-values): Use cl-loop.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/subr-x.el | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 173cd11fba4..7d1e1c9237a 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -33,6 +33,7 @@ ;;; Code: (require 'pcase) +(eval-when-compile (require 'cl-lib)) (defmacro internal--thread-argument (first? &rest forms) @@ -146,15 +147,11 @@ to bind a single value, BINDINGS can just be a plain tuple." (defsubst hash-table-keys (hash-table) "Return a list of keys in HASH-TABLE." - (let ((keys '())) - (maphash (lambda (k _v) (push k keys)) hash-table) - keys)) + (cl-loop for k being the hash-keys of hash-table collect k)) (defsubst hash-table-values (hash-table) "Return a list of values in HASH-TABLE." - (let ((values '())) - (maphash (lambda (_k v) (push v values)) hash-table) - values)) + (cl-loop for v being the hash-values of hash-table collect v)) (defsubst string-empty-p (string) "Check whether STRING is empty." |