diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-23 14:38:36 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-23 14:38:36 -0400 |
commit | 27fc3a3d43902bab109c5f08335f6132413764a2 (patch) | |
tree | 8082ca9c255ed9f7c3373c3cb9ab461f45e20a76 /src/value.cc | |
parent | 6e4581690de4aef96895177ac5d5ed66e9cec5d8 (diff) | |
download | ledger-27fc3a3d43902bab109c5f08335f6132413764a2.tar.gz ledger-27fc3a3d43902bab109c5f08335f6132413764a2.tar.bz2 ledger-27fc3a3d43902bab109c5f08335f6132413764a2.zip |
A sequence is false if all it contains is false
Diffstat (limited to 'src/value.cc')
-rw-r--r-- | src/value.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/value.cc b/src/value.cc index 54a6038f..96c8e269 100644 --- a/src/value.cc +++ b/src/value.cc @@ -94,7 +94,13 @@ value_t::operator bool() const case STRING: return ! as_string().empty(); case SEQUENCE: - return ! as_sequence().empty(); + if (! as_sequence().empty()) { + foreach (const value_t& value, as_sequence()) { + if (value) + return true; + } + } + return false; case POINTER: return ! as_any_pointer().empty(); default: |