Minor memory optimization

pull/14/head
Sam Bosley 12 years ago
parent f31057dc3d
commit 6bb95e16bb

@ -234,7 +234,7 @@ public class MakeChanges<TYPE extends RemoteModel> extends ServerToClientMessage
}
if (changes.has(NameMaps.localPropertyToServerColumnName(NameMaps.TABLE_ID_TASKS, Task.DUE_DATE))) {
Task t = PluginServices.getTaskDao().fetch(uuid, Task.PROPERTIES);
Task t = PluginServices.getTaskDao().fetch(uuid, ReminderService.NOTIFICATION_PROPERTIES);
if (t != null)
ReminderService.getInstance().scheduleAlarm(t);
}

@ -43,7 +43,7 @@ public final class ReminderService {
// --- constants
private static final Property<?>[] PROPERTIES = new Property<?>[] {
public static final Property<?>[] NOTIFICATION_PROPERTIES = new Property<?>[] {
Task.ID,
Task.CREATION_DATE,
Task.COMPLETION_DATE,
@ -124,7 +124,7 @@ public final class ReminderService {
* Schedules all alarms
*/
public void scheduleAllAlarms() {
TodorooCursor<Task> cursor = getTasksWithReminders(PROPERTIES);
TodorooCursor<Task> cursor = getTasksWithReminders(NOTIFICATION_PROPERTIES);
try {
Task task = new Task();
now = DateUtilities.now(); // Before mass scheduling, initialize now variable
@ -178,9 +178,9 @@ public final class ReminderService {
// read data if necessary
if(shouldPerformPropertyCheck) {
for(Property<?> property : PROPERTIES) {
for(Property<?> property : NOTIFICATION_PROPERTIES) {
if(!task.containsValue(property)) {
task = taskDao.fetch(task.getId(), PROPERTIES);
task = taskDao.fetch(task.getId(), NOTIFICATION_PROPERTIES);
if(task == null)
return;
break;

Loading…
Cancel
Save