Fix duplicates
This commit is contained in:
parent
d62aba0f72
commit
3a3c95a333
1 changed files with 2 additions and 5 deletions
|
@ -8,10 +8,7 @@ import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.text.Normalizer;
|
import java.text.Normalizer;
|
||||||
import java.util.Arrays;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +29,7 @@ public class ComputeResults implements Runnable {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
Path filePath = Paths.get(file.getAbsolutePath());
|
Path filePath = Paths.get(file.getAbsolutePath());
|
||||||
List<String> validStrings = Files.lines(filePath).parallel().filter(this::isValid).collect(Collectors.toList());
|
Set<String> validStrings = Files.lines(filePath).parallel().filter(this::isValid).collect(Collectors.toSet());
|
||||||
mainPanel.getValidNamesList().setListData(validStrings.toArray());
|
mainPanel.getValidNamesList().setListData(validStrings.toArray());
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException e) {
|
catch (FileNotFoundException e) {
|
||||||
|
|
Loading…
Reference in a new issue