summaryrefslogtreecommitdiff
path: root/src/iterators.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-28 02:34:40 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-10-28 02:34:40 -0400
commitbd96928410124e70e70ada7fd05820e2cf781d2c (patch)
treea054e62051e8a2cdb7351f9b166a1fba5d5ba43f /src/iterators.cc
parentade0a8b6f3eeb893eda2ae7355d503bf6514f147 (diff)
parent65e8eca6cfd394390c1e2091cf8674a93d2eae2d (diff)
downloadfork-ledger-bd96928410124e70e70ada7fd05820e2cf781d2c.tar.gz
fork-ledger-bd96928410124e70e70ada7fd05820e2cf781d2c.tar.bz2
fork-ledger-bd96928410124e70e70ada7fd05820e2cf781d2c.zip
Merge branch 'next'
Diffstat (limited to 'src/iterators.cc')
-rw-r--r--src/iterators.cc11
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);
}
}
}