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

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

[elpa] externals/disk-usage bcae407 21/26: Replace (delq (mapcar ...)) w


From: Pierre Neidhardt
Subject: [elpa] externals/disk-usage bcae407 21/26: Replace (delq (mapcar ...)) with cl-loop
Date: Tue, 26 Feb 2019 03:06:40 -0500 (EST)

branch: externals/disk-usage
commit bcae4074f63527844b8d24c714da1f0caedccb28
Author: Pierre Neidhardt <address@hidden>
Commit: Pierre Neidhardt <address@hidden>

    Replace (delq (mapcar ...)) with cl-loop
---
 disk-usage.el | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/disk-usage.el b/disk-usage.el
index 94c9da7..01667f2 100644
--- a/disk-usage.el
+++ b/disk-usage.el
@@ -256,18 +256,7 @@ See `disk-usage-add-filters' and 
`disk-usage-remove-filters'.")
   "This is the equivalent of running the shell command
 $ find . -type f -exec du -sb {} +"
   (setq directory (or directory default-directory))
-  (delq
-   nil
-   (mapcar (lambda (s)
-             (let* ((pair (split-string s "\t"))
-                    (name (cadr pair))
-                    (attributes (file-attributes name)))
-               (when (cl-loop for filter in disk-usage-filters
-                              always (funcall filter name attributes))
-                 (disk-usage--file-info-make
-                  :name name
-                  :size (string-to-number (cl-first pair))))))
-           (split-string (with-temp-buffer
+  (let ((pair-strings (split-string (with-temp-buffer
                            (process-file disk-usage--find-command nil '(t nil) 
nil
                                          directory
                                          "-type" "f"
@@ -275,7 +264,16 @@ $ find . -type f -exec du -sb {} +"
                                          disk-usage--du-command
                                          disk-usage--du-args "{}" "+")
                            (buffer-string))
-                         "\n" 'omit-nulls))))
+                                    "\n" 'omit-nulls)))
+    (cl-loop for pair-string in pair-strings
+             for pair = (split-string pair-string "\t")
+             for name = (cadr pair)
+             for attributes = (file-attributes name)
+             when (cl-loop for filter in disk-usage-filters
+                           always (funcall filter name attributes))
+             collect (disk-usage--file-info-make
+                      :name name
+                      :size (string-to-number (cl-first pair))))))
 
 (defcustom disk-usage-list-function #'disk-usage--list
   "Function that returns a list of `disk-usage--file-info'.



reply via email to

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