Update years in copyright line
[Sone.git] / src / main / java / net / pterodactylus / sone / template / ReplyGroupFilter.java
index bcf73d8..709ffbc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - ReplyGroupFilter.java - Copyright © 2010–2013 David Roden
+ * Sone - ReplyGroupFilter.java - Copyright © 2010–2015 David Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Set;
 
 import net.pterodactylus.sone.data.Post;
@@ -69,14 +70,14 @@ public class ReplyGroupFilter implements Filter {
                        replies.add(reply);
                }
                Map<Post, Map<String, Set<?>>> result = new HashMap<Post, Map<String, Set<?>>>();
-               for (Post post : postSones.keySet()) {
-                       if (result.containsKey(post)) {
+               for (Entry<Post, Set<Sone>> postEntry : postSones.entrySet()) {
+                       if (result.containsKey(postEntry.getKey())) {
                                continue;
                        }
                        Map<String, Set<?>> postResult = new HashMap<String, Set<?>>();
-                       postResult.put("sones", postSones.get(post));
-                       postResult.put("replies", postReplies.get(post));
-                       result.put(post, postResult);
+                       postResult.put("sones", postEntry.getValue());
+                       postResult.put("replies", postReplies.get(postEntry.getKey()));
+                       result.put(postEntry.getKey(), postResult);
                }
                return result;
        }