Code Cleanup

- Removed unreachable code from Table::sort_compare.
This commit is contained in:
Paul Beckingham 2010-08-07 20:34:54 -04:00
parent a8c8bf4671
commit a306892509

View file

@ -612,43 +612,24 @@ bool sort_compare (int left, int right)
if (cell_left && cell_right && *cell_left == *cell_right) if (cell_left && cell_right && *cell_left == *cell_right)
continue; continue;
// Note: Table::ascendingDueDate is not represented here because it is not
// possible to have a NULL due date, only a blank "".
// nothing < something. // nothing < something.
if (cell_left == NULL && cell_right != NULL) if (cell_left == NULL && cell_right != NULL)
{ return (sort_type == Table::ascendingNumeric ||
if (sort_type == Table::ascendingDueDate)
return true;
else if (sort_type == Table::descendingDueDate)
return false;
else if (sort_type == Table::ascendingNumeric ||
sort_type == Table::ascendingCharacter || sort_type == Table::ascendingCharacter ||
sort_type == Table::ascendingPriority || sort_type == Table::ascendingPriority ||
sort_type == Table::ascendingDate || sort_type == Table::ascendingDate ||
sort_type == Table::ascendingPeriod) sort_type == Table::ascendingPeriod) ? true : false;
return true;
return false;
}
// something > nothing. // something > nothing.
if (cell_left != NULL && cell_right == NULL) if (cell_left != NULL && cell_right == NULL)
{ return (sort_type == Table::ascendingNumeric ||
if (sort_type == Table::ascendingDueDate)
return false;
else if (sort_type == Table::descendingDueDate)
return true;
else if (sort_type == Table::ascendingNumeric ||
sort_type == Table::ascendingCharacter || sort_type == Table::ascendingCharacter ||
sort_type == Table::ascendingPriority || sort_type == Table::ascendingPriority ||
sort_type == Table::ascendingDate || sort_type == Table::ascendingDate ||
sort_type == Table::ascendingPeriod) sort_type == Table::ascendingPeriod) ? false : true;
return false;
return true;
}
// Differing data - do a proper comparison. // Differing data - do a proper comparison.
if (cell_left && cell_right) if (cell_left && cell_right)