From: Bozhidar Batsov Date: Wed, 20 May 2015 15:49:20 +0000 (+0300) Subject: Add new inline function `hash-table-empty-p' X-Git-Tag: emacs-25.0.90~2032 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7a22bb66a68d5393a5507ea4226e90090f59fff3;p=emacs.git Add new inline function `hash-table-empty-p' --- 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." (declare (indent 1) (debug if-let)) (list 'if-let bindings (macroexp-progn body))) +(defsubst hash-table-empty-p (table) + "Check whether TABLE is empty (has 0 elements)." + (zerop (hash-table-count table))) + (defsubst hash-table-keys (hash-table) "Return a list of keys in HASH-TABLE." (let ((keys '()))