1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-10 08:10:21 -08:00

Make string-chop-newline more efficient

* lisp/emacs-lisp/subr-x.el (string-chop-newline): Make more
efficient.
This commit is contained in:
Lars Ingebrigtsen 2020-12-21 23:18:05 +01:00
parent 768522750d
commit 7e86d3bb9b

View file

@ -341,7 +341,7 @@ string."
(defun string-chop-newline (string)
"Remove the final newline (if any) from STRING."
(replace-regexp-in-string "\n\\'" "" string))
(string-remove-suffix "\n" string))
(defun replace-region-contents (beg end replace-fn
&optional max-secs max-costs)