summaryrefslogtreecommitdiff
path: root/src/value.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-03-05 22:09:02 -0500
committerJohn Wiegley <johnw@newartisans.com>2010-03-05 22:14:14 -0500
commitfd4fa8a1140c0c78f480551bff3d76165c47519c (patch)
tree6bbf3e608dac8d0227b8e7f5b1b75e5a890604ca /src/value.cc
parent5850d041b6d8b55ffb85f0b8ce555a91597ab131 (diff)
downloadfork-ledger-fd4fa8a1140c0c78f480551bff3d76165c47519c.tar.gz
fork-ledger-fd4fa8a1140c0c78f480551bff3d76165c47519c.tar.bz2
fork-ledger-fd4fa8a1140c0c78f480551bff3d76165c47519c.zip
Change an exception test to a plain if
Diffstat (limited to 'src/value.cc')
-rw-r--r--src/value.cc6
1 files changed, 2 insertions, 4 deletions
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;
}