]> git.eshelyaron.com Git - emacs.git/commit
Don't mutate strings in cl-substitute
authorMattias EngdegÄrd <mattiase@acm.org>
Wed, 8 May 2024 10:13:48 +0000 (12:13 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 8 May 2024 16:53:14 +0000 (18:53 +0200)
commit514c53e2b34873142eea88c09d566064f16b6fbb
treec52f8d3772c94d42cc67d1b15f4c6dfcc664ed86
parent19480b59868a26d55de739775d5de7af20865f98
Don't mutate strings in cl-substitute

This fixes cl-substitute, cl-substitute-if, cl-substitute-if-not,
cl-nsubstitute, cl-nsubstitute-if and cl-nsubstitute-if-not,
when called with a string sequence argument.

* lisp/emacs-lisp/cl-seq.el (cl-nsubstitute):
Avoid running in O(n^2) time and make future-safe.

(cherry picked from commit de5a89254cb8645143e9f4e51a1727a7237109e8)
lisp/emacs-lisp/cl-seq.el