diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-28 01:18:27 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-28 01:18:27 -0400 |
commit | aa45d2d38cffe09ed2503e0df07bee373cc0e7de (patch) | |
tree | b1ee9eaba7e7ff364e571ba74eb4a02afef9983f /src/iterators.cc | |
parent | cc532c31aa8aa745d6d02c5c0cb22b3d75866590 (diff) | |
download | fork-ledger-aa45d2d38cffe09ed2503e0df07bee373cc0e7de.tar.gz fork-ledger-aa45d2d38cffe09ed2503e0df07bee373cc0e7de.tar.bz2 fork-ledger-aa45d2d38cffe09ed2503e0df07bee373cc0e7de.zip |
Further improvements to handling temporaries
Diffstat (limited to 'src/iterators.cc')
-rw-r--r-- | src/iterators.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/iterators.cc b/src/iterators.cc index 020f70b0..e9560cc0 100644 --- a/src/iterators.cc +++ b/src/iterators.cc @@ -108,24 +108,19 @@ void posts_commodities_iterator::reset(journal_t& journal) if (i != xacts_by_commodity.end()) { xact = (*i).second; } else { - xact_temps.push_back(new xact_t); - xact = xact_temps.back(); + xact = &temps.create_xact(); + xact_temps.push_back(xact); xact->payee = symbol; xact->_date = hpair.first.date(); xacts_by_commodity.insert (std::pair<string, xact_t *>(symbol, xact)); } - post_temps.push_back(post_t(account)); - post_t& temp = post_temps.back(); + post_t& temp = temps.create_post(*xact, account); temp._date = hpair.first.date(); - temp.xact = xact; temp.amount = hpair.second; - temp.set_flags(ITEM_GENERATED | ITEM_TEMP); temp.xdata().datetime = hpair.first; - - xact->add_post(&temp); } } } |