[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 5219ac0 422/426: [-let] Eliminate useless re-bindi
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash 5219ac0 422/426: [-let] Eliminate useless re-binding of symbols when sources are immutable |
Date: |
Tue, 04 Aug 2015 19:39:21 +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 7185db8 311/426: [Issue #83] Add `step` to `-slice`, (continued)
- [elpa] externals/dash 7185db8 311/426: [Issue #83] Add `step` to `-slice`, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2b69c14 411/426: Add dash.info and dash.texi to repo, Phillip Lord, 2015/08/04
- [elpa] externals/dash c61fc34 417/426: Add -remove-first/last, -map-first/last, -replace-first/last, Phillip Lord, 2015/08/04
- [elpa] externals/dash fb51f8f 304/426: Merge pull request #88 from steventlamb/topic/zip_cycle_pad, Phillip Lord, 2015/08/04
- [elpa] externals/dash d0c6fc0 371/426: Merge pull request #104 from fbergroth/linkify-docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash c08fcba 299/426: Fixed documentation of `-last-item'., Phillip Lord, 2015/08/04
- [elpa] externals/dash f96196a 289/426: Merge pull request #75 from Fuco1/prefix, Phillip Lord, 2015/08/04
- [elpa] externals/dash afe2781 388/426: Merge pull request #109 from bbatsov/threading-indentation, Phillip Lord, 2015/08/04
- [elpa] externals/dash 6b64ea7 303/426: Add functions for flexibly zipping uneven lists, Phillip Lord, 2015/08/04
- [elpa] externals/dash cd137e0 310/426: `-slice` should not fill the returned list with nils if to > length, Phillip Lord, 2015/08/04
- [elpa] externals/dash 5219ac0 422/426: [-let] Eliminate useless re-binding of symbols when sources are immutable,
Phillip Lord <=
- [elpa] externals/dash a06e66e 382/426: Add test for clean byte compilation, Phillip Lord, 2015/08/04
- [elpa] externals/dash 43dcd37 295/426: Only eval NUM in --dotimes once, Phillip Lord, 2015/08/04
- [elpa] externals/dash 4ecfea6 296/426: Merge pull request #79 from Fuco1/debug-forms, Phillip Lord, 2015/08/04
- [elpa] externals/dash 624c501 306/426: Add `-table` and `-table-flat`, Phillip Lord, 2015/08/04
- [elpa] externals/dash cf7ca23 415/426: [Fix #97] Add -remove-item, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2eefbec 386/426: Don't use an inline comment on a line of its own, Phillip Lord, 2015/08/04
- [elpa] externals/dash bbc1d9c 309/426: `--each-while` should also expose `it-index`, Phillip Lord, 2015/08/04
- [elpa] externals/dash 6bdcfa5 286/426: Add -split-on, -split-when, Phillip Lord, 2015/08/04
- [elpa] externals/dash bd85b7c 302/426: Make -zip support infinite (circular) lists, Phillip Lord, 2015/08/04
- [elpa] externals/dash 19fbc24 426/426: Fix anaphoric -spice-list macro, Phillip Lord, 2015/08/04