mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
only filter by date is the set is full
This commit is contained in:
@@ -24,7 +24,7 @@ public class FixedSizeSortedSet<E> extends TreeSet<E> {
|
||||
|
||||
@Override
|
||||
public boolean add(E e) {
|
||||
if (size() == maxSize) {
|
||||
if (isFull()) {
|
||||
E last = last();
|
||||
int comparison = comparator.compare(e, last);
|
||||
if (comparison < 0) {
|
||||
@@ -50,6 +50,10 @@ public class FixedSizeSortedSet<E> extends TreeSet<E> {
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
public boolean isFull() {
|
||||
return size() == maxSize;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<E> asList() {
|
||||
|
||||
@@ -161,7 +161,7 @@ public class FeedEntryStatusDAO extends GenericDAO<FeedEntryStatus> {
|
||||
predicates.add(builder.or(content, title));
|
||||
}
|
||||
|
||||
if (order != null && !set.isEmpty()) {
|
||||
if (order != null && !set.isEmpty() && set.isFull()) {
|
||||
Predicate filter = null;
|
||||
FeedEntry last = set.last();
|
||||
if (order == ReadingOrder.desc) {
|
||||
@@ -230,7 +230,7 @@ public class FeedEntryStatusDAO extends GenericDAO<FeedEntryStatus> {
|
||||
root.get(FeedEntryStatus_.entryInserted), newerThan));
|
||||
}
|
||||
|
||||
if (order != null && !set.isEmpty()) {
|
||||
if (order != null && !set.isEmpty() && set.isFull()) {
|
||||
Predicate filter = null;
|
||||
FeedEntryStatus last = set.last();
|
||||
if (order == ReadingOrder.desc) {
|
||||
|
||||
Reference in New Issue
Block a user