From 195be3ccf3d64fb486626d7dcd9f3acd762991e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 17 Nov 2016 20:38:31 +0100 Subject: [PATCH] Simplify code --- .../net/pterodactylus/sone/template/ReplyGroupFilter.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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); } -- 2.7.4