mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-21 07:43:08 +02:00
Code Cleanup
- Removed unreachable code from Table::sort_compare.
This commit is contained in:
parent
a8c8bf4671
commit
a306892509
1 changed files with 13 additions and 32 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue