emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 7a22bb6: Add new inline function `hash-table-empty-


From: Bozhidar Batsov
Subject: [Emacs-diffs] master 7a22bb6: Add new inline function `hash-table-empty-p'
Date: Wed, 20 May 2015 15:49:53 +0000

branch: master
commit 7a22bb66a68d5393a5507ea4226e90090f59fff3
Author: Bozhidar Batsov <address@hidden>
Commit: Bozhidar Batsov <address@hidden>

    Add new inline function `hash-table-empty-p'
---
 lisp/emacs-lisp/subr-x.el |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index bd178fa..dc5b7e9 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 '()))



reply via email to

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