From: David ‘Bombe’ Roden Date: Tue, 18 Mar 2014 05:45:30 +0000 (+0100) Subject: Simplify if conditions. X-Git-Tag: v2~250 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=dd83b5f4262dff21c983efddb0a5467358810a71;p=rhynodge.git Simplify if conditions. --- diff --git a/src/main/java/net/pterodactylus/rhynodge/filters/BlacklistFilter.java b/src/main/java/net/pterodactylus/rhynodge/filters/BlacklistFilter.java index 676d7be..a519934 100644 --- a/src/main/java/net/pterodactylus/rhynodge/filters/BlacklistFilter.java +++ b/src/main/java/net/pterodactylus/rhynodge/filters/BlacklistFilter.java @@ -56,7 +56,7 @@ public class BlacklistFilter implements Filter { return new TorrentState(from(torrentState.torrentFiles()).filter(new Predicate() { @Override public boolean apply(TorrentFile torrentFile) { - return (torrentFile == null) ? false : nameDoesNotMatchAFilterWord(torrentFile.name()); + return (torrentFile != null) && nameDoesNotMatchAFilterWord(torrentFile.name()); } private boolean nameDoesNotMatchAFilterWord(final String name) { diff --git a/src/main/java/net/pterodactylus/rhynodge/loader/Chain.java b/src/main/java/net/pterodactylus/rhynodge/loader/Chain.java index d54fae0..ab81754 100644 --- a/src/main/java/net/pterodactylus/rhynodge/loader/Chain.java +++ b/src/main/java/net/pterodactylus/rhynodge/loader/Chain.java @@ -85,10 +85,7 @@ public class Chain { if (!name.equals(parameter.name)) { return false; } - if (!value.equals(parameter.value)) { - return false; - } - return true; + return value.equals(parameter.value); } } @@ -328,10 +325,7 @@ public class Chain { if (!action.equals(chain.action)) { return false; } - if (updateInterval != chain.updateInterval) { - return false; - } - return true; + return updateInterval == chain.updateInterval; } }