fixed < bug
This commit is contained in:
parent
59c0692233
commit
2dc822291f
2 changed files with 8 additions and 0 deletions
|
|
@ -217,6 +217,9 @@ class balance_t
|
|||
if (! ((*i).second < bal.amount((*i).first)))
|
||||
return false;
|
||||
|
||||
if (bal.amounts.size() == 0 && amounts.size() == 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
bool operator<=(const balance_t& bal) const {
|
||||
|
|
@ -254,6 +257,9 @@ class balance_t
|
|||
if (! ((*i).second > bal.amount((*i).first)))
|
||||
return false;
|
||||
|
||||
if (bal.amounts.size() == 0 && amounts.size() == 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
bool operator>=(const balance_t& bal) const {
|
||||
|
|
|
|||
|
|
@ -269,6 +269,7 @@ void node_t::compute(balance_t& result, const details_t& details) const
|
|||
assert(right);
|
||||
left->compute(result, details);
|
||||
balance_t temp = result;
|
||||
result = 0;
|
||||
right->compute(result, details);
|
||||
switch (type) {
|
||||
case O_EQ: result = temp == result; break;
|
||||
|
|
@ -289,6 +290,7 @@ void node_t::compute(balance_t& result, const details_t& details) const
|
|||
assert(right);
|
||||
right->compute(result, details);
|
||||
balance_t temp = result;
|
||||
result = 0;
|
||||
left->compute(result, details);
|
||||
switch (type) {
|
||||
case O_ADD: result += temp; break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue