diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index cf486c342..a1feff0af 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -970,8 +970,7 @@ _computeBlocksPosition (NSArray *blocks) forComponentOfType: @"vtodo"] objectEnumerator]; showCompleted = [[request formValueForKey: @"show-completed"] intValue]; - task = [tasks nextObject]; - while (task) + while (task = [tasks nextObject]) { statusCode = [[task objectAtIndex: 2] intValue]; if (statusCode != 1 || showCompleted) @@ -983,7 +982,6 @@ _computeBlocksPosition (NSArray *blocks) [filteredTask addObject: statusFlag]; [filteredTasks addObject: filteredTask]; } - task = [tasks nextObject]; } [filteredTasks sortUsingSelector: @selector (compareTasksAscending:)];