summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/subr-x.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-12-21 23:18:05 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2020-12-21 23:18:05 +0100
commit7e86d3bb9b61e3e2c2389e66370df037bd8a8f43 (patch)
tree1b790e25a95fa98c9ee0ecb3fd46db469da55acf /lisp/emacs-lisp/subr-x.el
parent768522750ddbf68eb86b336fb41df9ec2fae6988 (diff)
downloademacs-7e86d3bb9b61e3e2c2389e66370df037bd8a8f43.tar.gz
emacs-7e86d3bb9b61e3e2c2389e66370df037bd8a8f43.tar.bz2
emacs-7e86d3bb9b61e3e2c2389e66370df037bd8a8f43.zip
Make string-chop-newline more efficient
* lisp/emacs-lisp/subr-x.el (string-chop-newline): Make more efficient.
Diffstat (limited to 'lisp/emacs-lisp/subr-x.el')
-rw-r--r--lisp/emacs-lisp/subr-x.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index 4d1a73a251a..1c8e1d6293f 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -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)