summaryrefslogtreecommitdiff
path: root/src/value.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-08-10 02:54:36 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-08-10 02:54:36 -0400
commit548a03e725752d2a61a76fb3d3ebb736f88c0afa (patch)
treecaaffdad8cdfec4f2027a074cda2c0f9a49a2369 /src/value.h
parent7ffb6c472c840acf8df5a3dd652d1c111787f87f (diff)
downloadfork-ledger-548a03e725752d2a61a76fb3d3ebb736f88c0afa.tar.gz
fork-ledger-548a03e725752d2a61a76fb3d3ebb736f88c0afa.tar.bz2
fork-ledger-548a03e725752d2a61a76fb3d3ebb736f88c0afa.zip
Regular expressions supplied after 'reg' or 'bal' are working again.
Diffstat (limited to 'src/value.h')
-rw-r--r--src/value.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/value.h b/src/value.h
index 8d638657..9c6b5112 100644
--- a/src/value.h
+++ b/src/value.h
@@ -803,20 +803,17 @@ public:
void push_back(const value_t& val) {
if (! val.is_null()) {
- if (is_null()) {
- *this = val;
+ if (is_null())
+ *this = sequence_t();
+ if (! is_sequence())
+ in_place_cast(SEQUENCE);
+
+ if (! val.is_sequence()) {
+ as_sequence_lval().push_back(val);
} else {
- if (! is_sequence())
- in_place_cast(SEQUENCE);
-
- if (! val.is_sequence()) {
- if (! val.is_null())
- as_sequence_lval().push_back(val);
- } else {
- const value_t::sequence_t& val_seq(val.as_sequence());
- std::copy(val_seq.begin(), val_seq.end(),
- back_inserter(as_sequence_lval()));
- }
+ const sequence_t& val_seq(val.as_sequence());
+ std::copy(val_seq.begin(), val_seq.end(),
+ back_inserter(as_sequence_lval()));
}
}
}
@@ -829,7 +826,7 @@ public:
} else {
as_sequence_lval().pop_back();
- const value_t::sequence_t& seq(as_sequence());
+ const sequence_t& seq(as_sequence());
std::size_t new_size = seq.size();
if (new_size == 0)
_reset();