From: David ‘Bombe’ Roden Date: Thu, 17 Nov 2016 19:38:31 +0000 (+0100) Subject: Simplify code X-Git-Tag: 0.9.7^2~426 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=195be3ccf3d64fb486626d7dcd9f3acd762991e8;p=Sone.git Simplify code --- diff --git a/src/main/java/net/pterodactylus/sone/template/ReplyGroupFilter.java b/src/main/java/net/pterodactylus/sone/template/ReplyGroupFilter.java index fba51f9..da12ca8 100644 --- a/src/main/java/net/pterodactylus/sone/template/ReplyGroupFilter.java +++ b/src/main/java/net/pterodactylus/sone/template/ReplyGroupFilter.java @@ -30,8 +30,6 @@ import net.pterodactylus.sone.data.Sone; import net.pterodactylus.util.template.Filter; import net.pterodactylus.util.template.TemplateContext; -import com.google.common.base.Optional; - /** * {@link Filter} implementation that groups replies by the post the are in * reply to, returning a map with the post as key and the list of replies as @@ -55,17 +53,17 @@ public class ReplyGroupFilter implements Filter { * All replies from a new-reply notification have posts, * ListNotificationFilters takes care of that. */ - Optional post = reply.getPost(); - Set sones = postSones.get(post.get()); + Post post = reply.getPost().get(); + Set sones = postSones.get(post); if (sones == null) { sones = new HashSet<>(); - postSones.put(post.get(), sones); + postSones.put(post, sones); } sones.add(reply.getSone()); - Set replies = postReplies.get(post.get()); + Set replies = postReplies.get(post); if (replies == null) { replies = new HashSet<>(); - postReplies.put(post.get(), replies); + postReplies.put(post, replies); } replies.add(reply); }