TaskService.cleanup was unecessarily expensive

pull/14/head
Sam Bosley 12 years ago
parent 0eb2159c64
commit 3f1b904ee3

@ -247,19 +247,7 @@ public class TaskService {
* Clean up tasks. Typically called on startup
*/
public void cleanup() {
TodorooCursor<Task> cursor = taskDao.query(
Query.select(Task.ID).where(TaskCriteria.hasNoTitle()));
try {
if(cursor.getCount() == 0)
return;
for(cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
long id = cursor.getLong(0);
taskDao.delete(id);
}
} finally {
cursor.close();
}
taskDao.deleteWhere(TaskCriteria.hasNoTitle());
}
/**

Loading…
Cancel
Save