Use reverse instead of explicit iteration.

master
Matus Goljer 11 years ago
parent dbe2bf2c5d
commit 4acab5d751
  1. 3
      dash.el

@ -1783,8 +1783,7 @@ Alias: `-uniq'"
"Return a new list containing the elements of LIST1 and elements of LIST2 that are not in LIST1. "Return a new list containing the elements of LIST1 and elements of LIST2 that are not in LIST1.
The test for equality is done with `equal', The test for equality is done with `equal',
or with `-compare-fn' if that's non-nil." or with `-compare-fn' if that's non-nil."
(let (result) (let ((result (reverse list)))
(--each list (!cons it result))
(--each list2 (unless (-contains? result it) (!cons it result))) (--each list2 (unless (-contains? result it) (!cons it result)))
(nreverse result))) (nreverse result)))

Loading…
Cancel
Save