summaryrefslogtreecommitdiff
path: root/src/generate.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/generate.cc')
-rw-r--r--src/generate.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/generate.cc b/src/generate.cc
index 05f754e6..60c6955e 100644
--- a/src/generate.cc
+++ b/src/generate.cc
@@ -350,9 +350,10 @@ void generate_posts_iterator::generate_xact(std::ostream& out)
out << '\n';
}
-post_t * generate_posts_iterator::operator()()
+void generate_posts_iterator::increment()
{
- post_t * post = posts();
+ post_t * post = *posts++;
+
if (post == NULL && quantity > 0) {
std::ostringstream buf;
generate_xact(buf);
@@ -364,7 +365,7 @@ post_t * generate_posts_iterator::operator()()
if (session.journal->parse(in, session) != 0) {
VERIFY(session.journal->xacts.back()->valid());
posts.reset(*session.journal->xacts.back());
- post = posts();
+ post = *posts++;
}
}
catch (std::exception&) {
@@ -382,7 +383,8 @@ post_t * generate_posts_iterator::operator()()
quantity--;
}
- return post;
+
+ m_node = post;
}
} // namespace ledger