[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)))))))
- [elpa] externals/dash 4640a2a 405/439: Allow for approx comparison of floats in tests, (continued)
- [elpa] externals/dash 4640a2a 405/439: Allow for approx comparison of floats in tests, Phillip Lord, 2015/08/04
- [elpa] externals/dash 3b63476 412/439: Move anaphoric function intro up into Functions section, Phillip Lord, 2015/08/04
- [elpa] externals/dash 19fbc24 426/439: Fix anaphoric -spice-list macro, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2db56f5 424/439: [-let] Add support for &as bindings (#115), Phillip Lord, 2015/08/04
- [elpa] externals/dash ffa37bf 425/439: Merge pull request #129 from holomorph/docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash 81b808d 409/439: Ignore dash.elc, Phillip Lord, 2015/08/04
- [elpa] externals/dash c61113b 420/439: [-let] Update outdated comment, Phillip Lord, 2015/08/04
- [elpa] externals/dash 733274f 398/439: Merge pull request #120 from holomorph/info-manual, Phillip Lord, 2015/08/04
- [elpa] externals/dash a803dd5 414/439: Merge readme changes, Phillip Lord, 2015/08/04
- [elpa] externals/dash 7bd6b3b 400/439: Add dir entry to texinfo template, Phillip Lord, 2015/08/04
- [elpa] externals/dash 5219ac0 422/439: [-let] Eliminate useless re-binding of symbols when sources are immutable,
Phillip Lord <=
- [elpa] externals/dash 0ef7384 395/439: Merge pull request #114 from fbergroth/update-test-case, Phillip Lord, 2015/08/04
- [elpa] externals/dash 349931e 399/439: Add @holomorph to list of contributors, Phillip Lord, 2015/08/04
- [elpa] externals/dash 1d4881f 413/439: Update README, Phillip Lord, 2015/08/04
- [elpa] externals/dash 36b7f49 419/439: [-let] Reuse the ignore-place predicate, Phillip Lord, 2015/08/04
- [elpa] externals/dash b308794 416/439: [Fix #73] Add a mention of -filter to -keep docstring, Phillip Lord, 2015/08/04
- [elpa] externals/dash 51a07b1 408/439: Merge pull request #127 from occidens/fixfn, Phillip Lord, 2015/08/04
- [elpa] externals/dash 8530742 410/439: Add @wasamasa and @occidens to list of contributors, Phillip Lord, 2015/08/04
- [elpa] externals/dash db784f8 403/439: Merge pull request #124 from occidens/skiptests, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9ebd172 421/439: [-let] Generate differently named symbols for temporary sources (makes, Phillip Lord, 2015/08/04
- [elpa] externals/dash 7d7a457 402/439: Allow run-tests.sh to skip tests, Phillip Lord, 2015/08/04