]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/seq/seq.el
Update seq.el to version 1.1.1
[gnu-emacs-elpa] / packages / seq / seq.el
index ca3651509e433f2d7a5e8a351b25f0fc5c9247df..bc0344d6b1bfa54a8f70c1b8f04eeef1acda9ec6 100644 (file)
@@ -4,7 +4,7 @@
 
 ;; Author: Nicolas Petton <nicolas@petton.fr>
 ;; Keywords: sequences
-;; Version: 1.1
+;; Version: 1.1.1
 ;; Package: seq
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -246,17 +246,16 @@ negative integer or 0, nil is returned."
   "Apply FUNCTION to each element of SEQ.
 Separate the elements of SEQ into an alist using the results as
 keys.  Keys are compared using `equal'."
-  (nreverse
-   (seq-reduce
-    (lambda (acc elt)
-      (let* ((key (funcall function elt))
-             (cell (assoc key acc)))
-        (if cell
-            (setcdr cell (push elt (cdr cell)))
-          (push (list key elt) acc))
-        acc))
-    seq
-    nil)))
+  (seq-reduce
+   (lambda (acc elt)
+     (let* ((key (funcall function elt))
+            (cell (assoc key acc)))
+       (if cell
+           (setcdr cell (push elt (cdr cell)))
+         (push (list key elt) acc))
+       acc))
+   (seq-reverse seq)
+   nil))
 
 (defun seq--drop-list (list n)
   "Return a list from LIST without its first N elements.