Skip to content

Commit

Permalink
removed the parallelStream from nuking as the overhead outweighs the …
Browse files Browse the repository at this point in the history
…benefits of it in the long run.
  • Loading branch information
BasketBandit committed Jan 3, 2019
1 parent acb1cd5 commit a2f0692
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Key: [+] added, [-] removed, [~] modified, [!] important.

## Y-1.0.2
+ [~] General code optimisations here and there, mostly conversions from verbose loops to streams.
+ [~] General code premature-optimisations here and there, mostly conversions from verbose loops to streams.
+ [~] Upgraded the [__nuke__] command to conform with the new standard which was overlooked in Y-1.0.1.
+ [~] Slightly optimised both the CommandExecutor and the GenericMessageController classes.
+ [~] Greatly improved the nuking speed of messages older than 2 weeks. (In preliminary testing, more testing needed in real world.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void executeCommand(MessageReceivedEvent e, String[] command) {
e.getTextChannel().deleteMessageById(nukeList.get(0).getId()).queue();
} else {
// If a message in the nuke list is older than 2 weeks it can't be mass deleted, so recursion will need to take place.
nukeList.parallelStream().forEach(message -> {
nukeList.forEach(message -> {
if(message.getCreationTime().isBefore(OffsetDateTime.now().minusWeeks(2))) {
message.delete().queue();
nukeList.remove(message);
Expand Down

0 comments on commit a2f0692

Please sign in to comment.