diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/value.cc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/value.cc b/src/value.cc index 5d32f8b7..1c2541b8 100644 --- a/src/value.cc +++ b/src/value.cc @@ -811,6 +811,26 @@ bool value_t::is_less_than(const value_t& val) const return as_string() < val.as_string(); break; + case SEQUENCE: + 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) + return false; + no_amounts = false; + } + return ! no_amounts; + } + default: + break; + } + break; + default: break; } @@ -881,6 +901,26 @@ bool value_t::is_greater_than(const value_t& val) const return as_string() > val.as_string(); break; + case SEQUENCE: + 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) + return false; + no_amounts = false; + } + return ! no_amounts; + } + default: + break; + } + break; + default: break; } |