summaryrefslogtreecommitdiff
path: root/src/value.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-23 19:31:06 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-23 19:31:06 -0400
commiteda6cbd0146d371653feec70e0eb3ee4e4c56379 (patch)
treeaeb4e1ace0f9b284789f66f3ceb30bed66946b93 /src/value.cc
parent014fde3418783d1ee1ec7fe4ea6c8b04ae7f6cd8 (diff)
parent93807fade69dd4f0ec575eda78fe1a77a85c24e3 (diff)
downloadfork-ledger-eda6cbd0146d371653feec70e0eb3ee4e4c56379.tar.gz
fork-ledger-eda6cbd0146d371653feec70e0eb3ee4e4c56379.tar.bz2
fork-ledger-eda6cbd0146d371653feec70e0eb3ee4e4c56379.zip
Merge branch 'next'
Diffstat (limited to 'src/value.cc')
-rw-r--r--src/value.cc20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/value.cc b/src/value.cc
index 99837832..c34792b2 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -901,13 +901,10 @@ bool value_t::is_less_than(const value_t& val) const
switch (val.type()) {
case INTEGER:
case AMOUNT: {
- if (val.is_nonzero())
- break;
-
bool no_amounts = true;
foreach (const balance_t::amounts_map::value_type& pair,
as_balance().amounts) {
- if (pair.second >= 0L)
+ if (pair.second >= val)
return false;
no_amounts = false;
}
@@ -927,12 +924,9 @@ bool value_t::is_less_than(const value_t& val) const
switch (val.type()) {
case INTEGER:
case AMOUNT: {
- if (val.is_nonzero())
- break;
-
bool no_amounts = true;
foreach (const value_t& value, as_sequence()) {
- if (value >= 0L)
+ if (value >= val)
return false;
no_amounts = false;
}
@@ -1023,13 +1017,10 @@ bool value_t::is_greater_than(const value_t& val) const
switch (val.type()) {
case INTEGER:
case AMOUNT: {
- if (val.is_nonzero())
- break;
-
bool no_amounts = true;
foreach (const balance_t::amounts_map::value_type& pair,
as_balance().amounts) {
- if (pair.second <= 0L)
+ if (pair.second <= val)
return false;
no_amounts = false;
}
@@ -1049,12 +1040,9 @@ bool value_t::is_greater_than(const value_t& val) const
switch (val.type()) {
case INTEGER:
case AMOUNT: {
- if (val.is_nonzero())
- break;
-
bool no_amounts = true;
foreach (const value_t& value, as_sequence()) {
- if (value <= 0L)
+ if (value <= val)
return false;
no_amounts = false;
}