aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBozhidar Batsov2015-05-20 18:49:20 +0300
committerBozhidar Batsov2015-05-20 18:49:20 +0300
commit7a22bb66a68d5393a5507ea4226e90090f59fff3 (patch)
treec7ae43292e8ca0d5d2e600a742f94a904567a444
parente2f5b72f78cbed16c90148d26df393385bacdcaf (diff)
downloademacs-7a22bb66a68d5393a5507ea4226e90090f59fff3.tar.gz
emacs-7a22bb66a68d5393a5507ea4226e90090f59fff3.zip
Add new inline function `hash-table-empty-p'
-rw-r--r--lisp/emacs-lisp/subr-x.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index bd178faa4af..dc5b7e9824c 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -140,6 +140,10 @@ to bind a single value, BINDINGS can just be a plain tuple."
140 (declare (indent 1) (debug if-let)) 140 (declare (indent 1) (debug if-let))
141 (list 'if-let bindings (macroexp-progn body))) 141 (list 'if-let bindings (macroexp-progn body)))
142 142
143(defsubst hash-table-empty-p (table)
144 "Check whether TABLE is empty (has 0 elements)."
145 (zerop (hash-table-count table)))
146
143(defsubst hash-table-keys (hash-table) 147(defsubst hash-table-keys (hash-table)
144 "Return a list of keys in HASH-TABLE." 148 "Return a list of keys in HASH-TABLE."
145 (let ((keys '())) 149 (let ((keys '()))