Skip to content

Commit

Permalink
Tidying up
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumBadger committed Aug 5, 2016
1 parent 29b0428 commit 978e9c8
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
Expand Down Expand Up @@ -640,7 +641,7 @@ public void run() {

mAfter = post.name;

Boolean isPostBlocked = getIsPostBlocked(isAll, blockedSubreddits, post);
final boolean isPostBlocked = getIsPostBlocked(isAll, blockedSubreddits, post);

if(!isPostBlocked
&& (!post.over_18 || isNsfwAllowed)
Expand Down Expand Up @@ -810,16 +811,19 @@ public void run() {
}
}

private Boolean getIsPostBlocked(boolean isAll, List<String> blockedSubreddits, RedditPost post) throws RedditSubreddit.InvalidSubredditNameException {
Boolean isPostBlocked = false;
private boolean getIsPostBlocked(
final boolean isAll,
@NonNull final List<String> blockedSubreddits,
@NonNull final RedditPost post) throws RedditSubreddit.InvalidSubredditNameException {

if (isAll) {
for (String blockedSubredditName : blockedSubreddits) {
if (blockedSubredditName.equalsIgnoreCase(RedditSubreddit.getCanonicalName(post.subreddit))) {
isPostBlocked = true;
return true;
}
}
}
return isPostBlocked;

return false;
}
}

0 comments on commit 978e9c8

Please sign in to comment.