emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] trunk r115287: * lisp/emacs-lisp/helpers.el (string-em


From: Stefan Monnier
Subject: Re: [Emacs-diffs] trunk r115287: * lisp/emacs-lisp/helpers.el (string-empty-p): New function.
Date: Fri, 29 Nov 2013 13:23:55 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> +  (string= string ""))

I think `equal' is preferable since it avoids signaling an error if
STRING is not a string.

> +(defsubst string-blank-p (string)
> +  "Check whether STRING is either empty or only whitespace."
> +  (string-empty-p (string-trim string)))

Better use (string-match-p "\\`...\\'" string) to avoid allocating a new
string.


        Stefan



reply via email to

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