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

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

[elpa] externals/dash 2a94ea5 209/316: Remove unnecessary helper functio


From: ELPA Syncer
Subject: [elpa] externals/dash 2a94ea5 209/316: Remove unnecessary helper function
Date: Mon, 15 Feb 2021 15:58:01 -0500 (EST)

branch: externals/dash
commit 2a94ea548063811e38ad4065ad3c6f216dfb4dd7
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Remove unnecessary helper function
    
    * dash.el (dash--vector-tail): Remove.
    (dash--match-vector-1, dash--match): Replace it with substring,
    which works for both strings and vectors.
---
 dash.el | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/dash.el b/dash.el
index 840e704..c605df2 100644
--- a/dash.el
+++ b/dash.el
@@ -1710,17 +1710,6 @@ SOURCE is a proper or improper list."
      (t ;; Handle improper lists.  Last matching place, no need for shift
       (dash--match match-form (dash--match-cons-get-cdr skip-cdr source))))))
 
-(defun dash--vector-tail (seq start)
-  "Return the tail of SEQ starting at START."
-  (cond
-   ((vectorp seq)
-    (let* ((re-length (- (length seq) start))
-           (re (make-vector re-length 0)))
-      (--dotimes re-length (aset re it (aref seq (+ it start))))
-      re))
-   ((stringp seq)
-    (substring seq start))))
-
 (defun dash--match-vector (match-form source)
   "Setup a vector matching environment and call the real matcher."
   (let ((s (dash--match-make-source-symbol)))
@@ -1768,7 +1757,7 @@ is discarded."
                      (eq m '&rest))
                 (prog1 (dash--match
                         (aref match-form (1+ i))
-                        `(dash--vector-tail ,source ,i))
+                        `(substring ,source ,i))
                   (setq i l)))
                ((and (symbolp m)
                      ;; do not match symbols starting with _
@@ -1919,7 +1908,7 @@ Key-value stores are disambiguated by placing a token 
&plist,
            (eq '&as (aref match-form 1)))
       (let ((s (aref match-form 0)))
         (cons (list s source)
-              (dash--match (dash--vector-tail match-form 2) s))))
+              (dash--match (substring match-form 2) s))))
      (t (dash--match-vector match-form source))))))
 
 (defun dash--normalize-let-varlist (varlist)



reply via email to

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