branch: externals/compat commit e00fc9c58622f21ace460b96a36800df53e9ed57 Author: Philip Kaludercic <phil...@posteo.net> Commit: Philip Kaludercic <phil...@posteo.net>
Simplify mapcan implementation Thanks to Mattias EngdegÄrd for point out the improvement. --- compat-26.1.el | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/compat-26.1.el b/compat-26.1.el index 1808b14..59d08eb 100644 --- a/compat-26.1.el +++ b/compat-26.1.el @@ -44,12 +44,7 @@ "Apply FUNC to each element of SEQUENCE. Concatenate the results by altering them (using `nconc'). SEQUENCE may be a list, a vector, a boolean vector, or a string." - (let (result) - (mapc - (lambda (elem) - (setq result (nconc result (funcall func elem)))) - sequence) - result)) + (apply #'nconc (mapcar func sequence))) (compat-advise line-number-at-pos (&optional position absolute) "Handle optional argument ABSOLUTE: