Removed whitespaces and changed comments

This commit is contained in:
BlyDoesCoding 2023-03-24 23:53:50 +01:00
parent b1b662fbb5
commit be100242e3
3 changed files with 9 additions and 21 deletions

9
.idea/workspace.xml generated
View file

@ -276,7 +276,14 @@
<option name="project" value="LOCAL" />
<updated>1679688274094</updated>
</task>
<option name="localTasksCounter" value="27" />
<task id="LOCAL-00027" summary="replaced Algorythm and made it way faster">
<created>1679696235787</created>
<option name="number" value="00027" />
<option name="presentableId" value="LOCAL-00027" />
<option name="project" value="LOCAL" />
<updated>1679696235787</updated>
</task>
<option name="localTasksCounter" value="28" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">

View file

@ -74,7 +74,6 @@ public class Main {
System.out.println("Commanded Threads " + saidThreads);
}
List<Path> pathList = new ArrayList<>();
List<Path> allFiles = new ArrayList<>();
@ -87,8 +86,6 @@ public class Main {
allFiles.addAll(pathList);
}
// calculations for multithreading
//The number of Cores or better said Threads that can be used
int availableThreads = Runtime.getRuntime().availableProcessors();
@ -119,8 +116,7 @@ public class Main {
}
//Start Multithreading
//sectionedList gives the thread their Assigned Part of Files and allFiles are all the Files
//sectionedList gives the thread their Assigned Part of Files
ThreadedCompare threadedCompare = new ThreadedCompare(sectionedList);
threadedCompare.start();
@ -135,7 +131,6 @@ public class Main {
} else if (showProgress) {
System.out.print("Progress: " + progress + " / " + filesToBeDone + " | " + (progress * 100 / filesToBeDone) + "%" + "\r");
}
}
ArrayList toRemove = new ArrayList<String>();
for (String md5: fileMap.keySet()) {
@ -158,7 +153,6 @@ public class Main {
}
}
// new algo
List<Path> allTheFilesWillBeDeleted = new ArrayList<>();
@ -176,17 +170,12 @@ public class Main {
}
if (deleteDups) {
delete(allTheFilesWillBeDeleted);
} else {
ask(doTheColorThingy, bytes, allTheFilesWillBeDeleted);
}
}
//print files and ask user
public static void ask(boolean color, long bytes, List<Path> deleteThem) {
@ -214,7 +203,6 @@ public class Main {
for (Path file : deleteThem) {
if (file != null) {file.toFile().delete();}
}
}

View file

@ -29,7 +29,6 @@ public class ThreadedCompare extends Thread {
throw new RuntimeException(e);
}
if (Main.fileMap.containsKey(MD5)) {
fileArray.addAll(Main.fileMap.get(MD5));
Main.fileMap.put(MD5, fileArray);
@ -37,17 +36,11 @@ public class ThreadedCompare extends Thread {
Main.fileMap.put(MD5, fileArray);
}
Main.progress++;
}
Main.completedThreads++;
}
//this is used to get the MD5 String of one of the files (one of them is just fine since they both have the same value)