projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplify sorting of posts.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
data
/
impl
/
SoneImpl.java
diff --git
a/src/main/java/net/pterodactylus/sone/data/impl/SoneImpl.java
b/src/main/java/net/pterodactylus/sone/data/impl/SoneImpl.java
index
6da31fc
..
44111aa
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/data/impl/SoneImpl.java
+++ b/
src/main/java/net/pterodactylus/sone/data/impl/SoneImpl.java
@@
-47,6
+47,7
@@
import net.pterodactylus.sone.freenet.wot.OwnIdentity;
import freenet.keys.FreenetURI;
import freenet.keys.FreenetURI;
+import com.google.common.collect.FluentIterable;
import com.google.common.hash.Hasher;
import com.google.common.hash.Hashing;
import com.google.common.hash.Hasher;
import com.google.common.hash.Hashing;
@@
-354,12
+355,9
@@
public class SoneImpl implements LocalSone {
* @return All posts of this Sone
*/
public List<Post> getPosts() {
* @return All posts of this Sone
*/
public List<Post> getPosts() {
- List<Post> sortedPosts;
synchronized (this) {
synchronized (this) {
-
sortedPosts = new ArrayList<Post>(posts
);
+
return FluentIterable.from(posts).toSortedList(Post.TIME_COMPARATOR
);
}
}
- Collections.sort(sortedPosts, Post.TIME_COMPARATOR);
- return sortedPosts;
}
/**
}
/**