projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7685227
)
Make string-chop-newline more efficient
author
Lars Ingebrigtsen
<larsi@gnus.org>
Mon, 21 Dec 2020 22:18:05 +0000
(23:18 +0100)
committer
Lars Ingebrigtsen
<larsi@gnus.org>
Mon, 21 Dec 2020 22:18:05 +0000
(23:18 +0100)
* lisp/emacs-lisp/subr-x.el (string-chop-newline): Make more
efficient.
lisp/emacs-lisp/subr-x.el
patch
|
blob
|
history
diff --git
a/lisp/emacs-lisp/subr-x.el
b/lisp/emacs-lisp/subr-x.el
index 4d1a73a251a433b81d8e9d8ec27369f5cf981a4b..1c8e1d6293f391a3c1b82115e67419cd49978c5a 100644
(file)
--- 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)