Skip to content

Commit

Permalink
replaced for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
rupert-griffin committed Jun 25, 2024
1 parent 022fabc commit 6ec00b7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/emissary/output/filter/AbstractFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.Nullable;

/**
Expand Down Expand Up @@ -170,11 +171,10 @@ protected void initializeOutputTypes(@Nullable final Configurator config) {
this.outputTypes = config.findEntriesAsSet("OUTPUT_TYPE");
this.logger.debug("Loaded {} output types for filter {}", this.outputTypes.size(), this.outputTypes);
this.denylist = config.findEntriesAsSet("DENYLIST");
for (String denyItem : this.denylist) {
if (denyItem.endsWith("*")) {
this.wildCardDenylist.add(denyItem.substring(0, denyItem.length() - 1));
}
}
this.wildCardDenylist = this.denylist.stream()
.filter(i -> i.endsWith("*"))
.map(i -> i.substring(0, i.length() - 1))
.collect(Collectors.toSet());
this.wildCardDenylist.forEach(i -> this.denylist.remove(i));
this.logger.debug("Loaded {} ignorelist types for filter {}", this.denylist.size(), this.denylist);
this.logger.debug("Loaded {} wildcard suffix ignorelist types for filter {}", this.wildCardDenylist.size(), this.wildCardDenylist);
Expand Down

0 comments on commit 6ec00b7

Please sign in to comment.