Corrected a case for value < value

This commit is contained in:
John Wiegley 2010-03-06 00:58:05 -05:00
parent 93e0d8c67a
commit 7e79cd82cd

View file

@ -857,7 +857,9 @@ bool value_t::is_less_than(const value_t& val) const
case INTEGER:
return as_amount() < val.as_long();
case AMOUNT:
if (as_amount().commodity() == val.as_amount().commodity())
if (as_amount().commodity() == val.as_amount().commodity() ||
! as_amount().has_commodity() ||
! val.as_amount().has_commodity())
return as_amount() < val.as_amount();
else
return commodity_t::compare_by_commodity()(&as_amount(), &val.as_amount());