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

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

[elpa] externals/dash 5219ac0 422/439: [-let] Eliminate useless re-bindi


From: Phillip Lord
Subject: [elpa] externals/dash 5219ac0 422/439: [-let] Eliminate useless re-binding of symbols when sources are immutable
Date: Tue, 04 Aug 2015 20:31:38 +0000

branch: externals/dash
commit 5219ac04b70e3e7c28679e75f55a7a8d75ad262f
Author: Matus Goljer <address@hidden>
Commit: Matus Goljer <address@hidden>

    [-let] Eliminate useless re-binding of symbols when sources are immutable
---
 dash.el |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dash.el b/dash.el
index a5d6d62..b8822ac 100644
--- a/dash.el
+++ b/dash.el
@@ -1337,6 +1337,9 @@ SOURCE is a proper or improper list."
      ;; don't bind `s' if we only have one sub-pattern
      ((= (length match-form) 1)
       (dash--match (aref match-form 0) `(aref ,source 0)))
+     ;; if the source is a symbol, we don't need to re-bind it
+     ((symbolp source)
+      (dash--match-vector-1 match-form source))
      ;; don't bind `s' if we only have one sub-pattern which is not ignored
      ((let* ((ignored-places (mapcar 'dash--match-ignore-place-p match-form))
              (ignored-places-n (length (-remove 'null ignored-places))))
@@ -1395,6 +1398,9 @@ kv can be any key-value store, such as plist, alist or 
hash-table."
      ;; don't bind `s' if we only have one sub-pattern (&type key val)
      ((= (length match-form) 3)
       (dash--match-kv-1 (cdr match-form) source (car match-form)))
+     ;; if the source is a symbol, we don't need to re-bind it
+     ((symbolp source)
+      (dash--match-kv-1 (cdr match-form) source (car match-form)))
      (t
       (cons (list s source) (dash--match-kv-1 (cdr match-form) s (car 
match-form)))))))
 



reply via email to

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