summaryrefslogtreecommitdiff
path: root/src/value.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-28 23:46:14 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-10-28 23:46:14 -0400
commit2b3f3e9867431174f5b5b25e47098a7218213a82 (patch)
treea27560ebcfad59813cd5e988ffae933c1d04cec3 /src/value.h
parent375f6c257d23ac7655ce0738a72acceb78119457 (diff)
parent52433e56e562976887325ce48a6271abb82a89aa (diff)
downloadledger-2b3f3e9867431174f5b5b25e47098a7218213a82.tar.gz
ledger-2b3f3e9867431174f5b5b25e47098a7218213a82.tar.bz2
ledger-2b3f3e9867431174f5b5b25e47098a7218213a82.zip
Merge branch 'next'
Diffstat (limited to 'src/value.h')
-rw-r--r--src/value.h20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/value.h b/src/value.h
index 9aa3cb04..31850894 100644
--- a/src/value.h
+++ b/src/value.h
@@ -818,13 +818,11 @@ public:
}
void push_back(const value_t& val) {
- if (! val.is_null()) {
- if (is_null())
- *this = sequence_t();
- if (! is_sequence())
- in_place_cast(SEQUENCE);
- as_sequence_lval().push_back(val);
- }
+ if (is_null())
+ *this = sequence_t();
+ if (! is_sequence())
+ in_place_cast(SEQUENCE);
+ as_sequence_lval().push_back(val);
}
void pop_back() {
@@ -855,24 +853,18 @@ public:
}
sequence_t::iterator begin() {
- VERIFY(is_sequence());
return as_sequence_lval().begin();
}
sequence_t::iterator end() {
- VERIFY(is_sequence());
- // This special hack is because we never used end() in a context which
- // needs us to call _dup().
- return boost::get<sequence_t *>(storage->data)->end();
+ return as_sequence_lval().end();
}
sequence_t::const_iterator begin() const {
- VERIFY(is_sequence());
return as_sequence().begin();
}
sequence_t::const_iterator end() const {
- VERIFY(is_sequence());
return as_sequence().end();
}