diff options
author | John Wiegley <johnw@newartisans.com> | 2010-03-17 06:22:43 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-03-17 06:22:43 -0400 |
commit | 7ca8149ec5c7fa88d98df83e6260210372223036 (patch) | |
tree | 4c5741d682e89b1ea4e567c32a78d32ba17737db /src/value.cc | |
parent | 3bb4cb6b6055f180112f357cf23463a1b8c186c5 (diff) | |
parent | 8dd362b57cf2b49c5268e72898ae873522d8756f (diff) | |
download | fork-ledger-7ca8149ec5c7fa88d98df83e6260210372223036.tar.gz fork-ledger-7ca8149ec5c7fa88d98df83e6260210372223036.tar.bz2 fork-ledger-7ca8149ec5c7fa88d98df83e6260210372223036.zip |
Merge branch 'next'
Diffstat (limited to 'src/value.cc')
-rw-r--r-- | src/value.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/value.cc b/src/value.cc index 7d079caf..54798162 100644 --- a/src/value.cc +++ b/src/value.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2009, John Wiegley. All rights reserved. + * Copyright (c) 2003-2010, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -857,12 +857,12 @@ 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() || + ! as_amount().has_commodity() || + ! val.as_amount().has_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; } |