Skip to content

Commit

Permalink
Remove duplicates in open files
Browse files Browse the repository at this point in the history
  • Loading branch information
games647 committed Aug 11, 2016
1 parent a27c467 commit 3b0f953
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public void start(String host, int port, int amount, int delay, String nameForma
Bot bot;
if (proxies != null) {
Proxy proxy = proxies.get(i % proxies.size());
LOGGER.info("USING PROXY " + proxy);
bot = new Bot(account, proxy);
} else {
bot = new Bot(account);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void actionPerformed(ActionEvent actionEvent) {
botManager.getThreadPool().submit(() -> {
try {
List<String> lines = Files.readAllLines(proxyFile.toPath());
List<String> names = lines.stream().collect(Collectors.toList());
List<String> names = lines.stream().distinct().collect(Collectors.toList());

LambdaAttack.getLogger().log(Level.INFO, "Loaded {0} names", names.size());
botManager.setNames(names);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void actionPerformed(ActionEvent actionEvent) {
botManager.getThreadPool().submit(() -> {
try {
List<String> lines = Files.readAllLines(proxyFile.toPath());
List<Proxy> proxies = lines.stream().map((line) -> {
List<Proxy> proxies = lines.stream().distinct().map((line) -> {
String host = line.split(":")[0];
int port = Integer.parseInt(line.split(":")[1]);

Expand Down

0 comments on commit 3b0f953

Please sign in to comment.