diff options
author | John Wiegley <johnw@newartisans.com> | 2007-05-19 02:58:48 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:53 -0400 |
commit | bf2c8c0f486926b3c86f5f619b1d4e26cdd92188 (patch) | |
tree | 27c1fe7a41191a6c5d738c3c6c197626225e7045 /src/value.h | |
parent | b6ab7deb63d3e3e22ecd4d6c70c6249db2ba558c (diff) | |
download | ledger-bf2c8c0f486926b3c86f5f619b1d4e26cdd92188.tar.gz ledger-bf2c8c0f486926b3c86f5f619b1d4e26cdd92188.tar.bz2 ledger-bf2c8c0f486926b3c86f5f619b1d4e26cdd92188.zip |
Everything is working again except for predicates.
Diffstat (limited to 'src/value.h')
-rw-r--r-- | src/value.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/value.h b/src/value.h index c9281121..8fa3f8c9 100644 --- a/src/value.h +++ b/src/value.h @@ -216,12 +216,12 @@ public: TRACE_CTOR(value_t, "const sequence_t&"); set_sequence(val); } - value_t(xml::node_t * xml_node) { + value_t(xml::node_t * item) { TRACE_CTOR(value_t, "xml::node_t *"); - set_xml_node(xml_node); + set_xml_node(item); } template <typename T> - value_t(T * item) { + explicit value_t(T * item) { TRACE_CTOR(value_t, "T *"); set_pointer(item); } @@ -230,9 +230,8 @@ public: } value_t& operator=(const value_t& val) { - if (this == &val || storage == val.storage) - return *this; - storage = val.storage; + if (! (this == &val || storage == val.storage)) + storage = val.storage; return *this; } @@ -537,11 +536,14 @@ public: if (! is_sequence()) in_place_cast(SEQUENCE); - if (! val.is_sequence()) - as_sequence_lval().push_back(val); - else - std::copy(val.as_sequence().begin(), val.as_sequence().end(), - as_sequence_lval().end()); + value_t::sequence_t& seq(as_sequence_lval()); + if (! val.is_sequence()) { + if (! val.is_null()) + seq.push_back(val); + } else { + const value_t::sequence_t& val_seq(val.as_sequence()); + std::copy(val_seq.begin(), val_seq.end(), back_inserter(seq)); + } } } |