Change an exception test to a plain if

This commit is contained in:
John Wiegley 2010-03-05 22:09:02 -05:00
parent 5850d041b6
commit fd4fa8a114

View file

@ -857,12 +857,10 @@ bool value_t::is_less_than(const value_t& val) const
case INTEGER: case INTEGER:
return as_amount() < val.as_long(); return as_amount() < val.as_long();
case AMOUNT: case AMOUNT:
try { if (as_amount().commodity() == val.as_amount().commodity())
return as_amount() < val.as_amount(); return as_amount() < val.as_amount();
} else
catch (const amount_error&) {
return commodity_t::compare_by_commodity()(&as_amount(), &val.as_amount()); return commodity_t::compare_by_commodity()(&as_amount(), &val.as_amount());
}
default: default:
break; break;
} }