From dd83b5f4262dff21c983efddb0a5467358810a71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 18 Mar 2014 06:45:30 +0100 Subject: [PATCH] Simplify if conditions. --- .../net/pterodactylus/rhynodge/filters/BlacklistFilter.java | 2 +- src/main/java/net/pterodactylus/rhynodge/loader/Chain.java | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) 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; } } -- 2.7.4