diff options
author | Sean Allred <code@seanallred.com> | 2015-01-01 19:03:34 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2015-01-01 19:03:34 -0500 |
commit | 01ac19db7ff5087e3c2b481a57d21d242ee9fb34 (patch) | |
tree | 76bff5cb0fc075542ad4f8b135b770591993c2d2 /sx.el | |
parent | 9650a1541b43da18067466df7671d23d5baffeed (diff) | |
parent | bf4f193a76100917764f249023f4844a2ca15b2c (diff) |
Merge pull request #185 from vermiculus/ert-refactor
Refactor tests
Diffstat (limited to 'sx.el')
-rw-r--r-- | sx.el | 44 |
1 files changed, 0 insertions, 44 deletions
@@ -239,50 +239,6 @@ and sequences of strings." (funcall first-f sequence-sep) ";")))))) -(defun sx--filter-data (data desired-tree) - "Filter DATA and return the DESIRED-TREE. - -For example: - - (sx--filter-data - '((prop1 . value1) - (prop2 . value2) - (prop3 - (test1 . 1) - (test2 . 2)) - (prop4 . t)) - '(prop1 (prop3 test2))) - -would yield - - ((prop1 . value1) - (prop3 - (test2 . 2)))" - (if (vectorp data) - (apply #'vector - (mapcar (lambda (entry) - (sx--filter-data - entry desired-tree)) - data)) - (delq - nil - (mapcar (lambda (cons-cell) - ;; @TODO the resolution of `f' is O(2n) in the worst - ;; case. It may be faster to implement the same - ;; functionality as a `while' loop to stop looking the - ;; list once it has found a match. Do speed tests. - ;; See edfab4443ec3d376c31a38bef12d305838d3fa2e. - (let ((f (or (memq (car cons-cell) desired-tree) - (assoc (car cons-cell) desired-tree)))) - (when f - (if (and (sequencep (cdr cons-cell)) - (sequencep (elt (cdr cons-cell) 0))) - (cons (car cons-cell) - (sx--filter-data - (cdr cons-cell) (cdr f))) - cons-cell)))) - data)))) - (defun sx--shorten-url (url) "Shorten URL hiding anything other than the domain. Paths after the domain are replaced with \"...\". |