Extend commodity_t::compare_by_commodity::operator()

This commit is contained in:
John Wiegley 2012-03-19 00:30:15 -05:00
parent db1bca2ad8
commit d6274fee19

View file

@ -481,6 +481,15 @@ bool commodity_t::compare_by_commodity::operator()(const amount_t * left,
if (aleftcomm.details.tag && arightcomm.details.tag)
return *aleftcomm.details.tag < *arightcomm.details.tag;
if (! aleftcomm.details.value_expr && arightcomm.details.value_expr)
return true;
if (aleftcomm.details.value_expr && ! arightcomm.details.value_expr)
return false;
if (aleftcomm.details.value_expr && arightcomm.details.value_expr)
return (aleftcomm.details.value_expr->text() <
arightcomm.details.value_expr->text());
assert(false);
return true;
}