emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/compat e00fc9c 03/99: Simplify mapcan implementation


From: ELPA Syncer
Subject: [elpa] externals/compat e00fc9c 03/99: Simplify mapcan implementation
Date: Sun, 17 Oct 2021 05:57:47 -0400 (EDT)

branch: externals/compat
commit e00fc9c58622f21ace460b96a36800df53e9ed57
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@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:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]