HabitMatcher: only compute today's value if needed

This commit is contained in:
2016-10-09 11:58:03 -04:00
parent 50da14022f
commit f3b9fc825a

View File

@@ -76,8 +76,12 @@ public class HabitMatcher
if (!isArchivedAllowed() && habit.isArchived()) return false; if (!isArchivedAllowed() && habit.isArchived()) return false;
if (isReminderRequired() && !habit.hasReminder()) return false; if (isReminderRequired() && !habit.hasReminder()) return false;
if(!isCompletedAllowed())
{
int todayCheckmark = habit.getCheckmarks().getTodayValue(); int todayCheckmark = habit.getCheckmarks().getTodayValue();
if (todayCheckmark != UNCHECKED && !isCompletedAllowed()) return false; if (todayCheckmark != UNCHECKED) return false;
}
if(!allowedColors.contains(habit.getColor())) return false; if(!allowedColors.contains(habit.getColor())) return false;
return true; return true;
} }