]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove the calls to `seq-into` from `seq-concatenate`
authorNicolas Petton <nicolas@petton.fr>
Sun, 23 Aug 2015 19:09:01 +0000 (21:09 +0200)
committerNicolas Petton <nicolas@petton.fr>
Sun, 23 Aug 2015 19:14:09 +0000 (21:14 +0200)
Since most new types of seq would have to be defined as sequences (cons
cells or CL structs, mostly), there is no need to convert the seqs to
sequences (which can be a fairly expensive operation).

* lisp/emacs-lisp/seq.el (seq-concatenate): Do not ensure that seqs are
sequences.

lisp/emacs-lisp/seq.el

index f9e0e9c0fa89928748f533ce1f2dc7c29bb11277..5ce4d91ec3e11bbac70b80729943facd30c1adf7 100644 (file)
@@ -200,18 +200,11 @@ The result is a sequence of the same type as SEQ."
 TYPE must be one of following symbols: vector, string or list.
 
 \n(fn TYPE SEQUENCE...)"
-  ;; Since new seq types might be defined, we need to make sure that
-  ;; all seqs are actual sequences.
-  (let ((sequences (seq-map (lambda (s)
-                              (if (sequencep s)
-                                  s
-                                (seq-into s 'list)))
-                            seqs)))
-    (pcase type
-      (`vector (apply #'vconcat sequences))
-      (`string (apply #'concat sequences))
-      (`list (apply #'append (append sequences '(nil))))
-      (_ (error "Not a sequence type name: %S" type)))))
+  (pcase type
+    (`vector (apply #'vconcat seqs))
+    (`string (apply #'concat seqs))
+    (`list (apply #'append (append seqs '(nil))))
+    (_ (error "Not a sequence type name: %S" type))))
 
 (cl-defgeneric seq-into (seq type)
   "Convert the sequence SEQ into a sequence of type TYPE.