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

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

[elpa] externals/dired-duplicates 8bd3de781d 55/57: Optimize processing


From: ELPA Syncer
Subject: [elpa] externals/dired-duplicates 8bd3de781d 55/57: Optimize processing of same-size-files and same-files
Date: Sat, 4 Nov 2023 06:58:31 -0400 (EDT)

branch: externals/dired-duplicates
commit 8bd3de781d889063ec5a532457fe17bee817b091
Author: Harald Judt <h.judt@gmx.at>
Commit: Harald Judt <h.judt@gmx.at>

    Optimize processing of same-size-files and same-files
    
    It is only required to know there is more than one file, not how many. This
    will help improving performance when there are many files of the same size, 
or
    many duplicate files.
    
    Signed-off-by: Harald Judt <h.judt@gmx.at>
---
 dired-duplicates.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dired-duplicates.el b/dired-duplicates.el
index d38ee2726e..b6ea80b5c8 100644
--- a/dired-duplicates.el
+++ b/dired-duplicates.el
@@ -135,15 +135,15 @@ duplicate files as values."
            do (setf (gethash size same-size-table)
                     (append (gethash size same-size-table) (list f)))
            finally
-           (cl-loop for same-size-files being the hash-values in 
same-size-table
-                    if (> (length same-size-files) 1) do
+           (cl-loop for same-size-files being the hash-value in same-size-table
+                    if (cdr same-size-files) do
                     (cl-loop for f in same-size-files
                              for checksum = (dired-duplicates-checksum-file f)
                              do (setf (gethash checksum checksum-table)
                                       (append (gethash checksum 
checksum-table) (list f)))))
            (cl-loop for same-files being the hash-value in checksum-table 
using (hash-key checksum)
                     do
-                    (if (> (length same-files) 1)
+                    (if (cdr same-files)
                         (setf (gethash checksum checksum-table)
                               (cons (file-attribute-size (file-attributes (car 
same-files)))
                                     (sort same-files #'string<)))



reply via email to

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