#REFACTORING by cg
authorClaus Gittinger <cg@exept.de>
Mon, 01 Jan 2018 12:54:25 +0100
changeset 17870 b270a77dd705
parent 17869 4f02f7359cd2
child 17871 7f0b6e10415d
#REFACTORING by cg class: FileBrowser changed: #fileFindDuplicates
FileBrowser.st
--- a/FileBrowser.st	Mon Jan 01 12:22:20 2018 +0100
+++ b/FileBrowser.st	Mon Jan 01 12:54:25 2018 +0100
@@ -2631,23 +2631,23 @@
 
     self withWaitCursorDo:[
         duplicatesDictionary := AbstractFileBrowser fileFindDuplicatesIn:{ currentDirectory asFilename }.
-
-        info := OrderedCollection new.
-        duplicatesDictionary do:[:assoc |
-            |fn1 fn2|
-
-            fn1 := assoc key.
-            fn2 := assoc value.
-            (fn1 includes:Character space) ifTrue:[
-                fn1 := '"' , fn1 , '"'
+        duplicatesDictionary isEmpty ifTrue:[
+            info := 'No duplicate files found.'
+        ] ifFalse:[
+            info := OrderedCollection new.
+            duplicatesDictionary do:[:assoc |
+                |dup orig|
+
+                dup := assoc key.
+                orig := assoc value.
+                (dup includes:Character space) ifTrue:[
+                    dup := '"' , dup , '"'
+                ].
+                (orig includes:Character space) ifTrue:[
+                    orig := '"' , orig , '"'
+                ].
+                info add:(dup , ' duplicate of ' , orig)
             ].
-            (fn2 includes:Character space) ifTrue:[
-                fn2 := '"' , fn2 , '"'
-            ].
-            info add:(fn1 , ' same as ' , fn2)
-        ].
-        info isEmpty ifTrue:[
-            info := 'No duplicate files found.'
         ].
     ].