From fd4fa8a1140c0c78f480551bff3d76165c47519c Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 5 Mar 2010 22:09:02 -0500 Subject: Change an exception test to a plain if --- src/value.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/value.cc') diff --git a/src/value.cc b/src/value.cc index 43524d3f..a1316568 100644 --- a/src/value.cc +++ b/src/value.cc @@ -857,12 +857,10 @@ bool value_t::is_less_than(const value_t& val) const case INTEGER: return as_amount() < val.as_long(); case AMOUNT: - try { + if (as_amount().commodity() == val.as_amount().commodity()) return as_amount() < val.as_amount(); - } - catch (const amount_error&) { + else return commodity_t::compare_by_commodity()(&as_amount(), &val.as_amount()); - } default: break; } -- cgit v1.2.3