summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorNicolas Petton <nicolas@petton.fr>2015-08-23 21:09:01 +0200
committerNicolas Petton <nicolas@petton.fr>2015-08-23 21:14:09 +0200
commitc13a4df51ca2b82c03ef13bca1151f727cfc64f6 (patch)
tree574ccf4cb23866b2b86bab10b0c1273716966a29 /lisp/emacs-lisp
parent20aa61c0a3c152e5b829d02ea20a4d89c692b91b (diff)
downloademacs-c13a4df51ca2b82c03ef13bca1151f727cfc64f6.tar.gz
emacs-c13a4df51ca2b82c03ef13bca1151f727cfc64f6.tar.bz2
emacs-c13a4df51ca2b82c03ef13bca1151f727cfc64f6.zip
Remove the calls to `seq-into` from `seq-concatenate`
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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/seq.el17
1 files changed, 5 insertions, 12 deletions
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index f9e0e9c0fa8..5ce4d91ec3e 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -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.