summaryrefslogtreecommitdiff
path: root/src/convert.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/convert.cc')
-rw-r--r--src/convert.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/convert.cc b/src/convert.cc
index 5d3f23fa..493fbb7a 100644
--- a/src/convert.cc
+++ b/src/convert.cc
@@ -62,10 +62,10 @@ value_t convert_command(call_scope_t& args)
post_map_t post_map;
xacts_iterator journal_iter(journal);
- while (xact_t * xact = journal_iter()) {
+ while (xact_t * xact = *journal_iter++) {
post_t * post = NULL;
xact_posts_iterator xact_iter(*xact);
- while ((post = xact_iter()) != NULL) {
+ while ((post = *xact_iter++) != NULL) {
if (post->account == bucket)
break;
}
@@ -95,7 +95,7 @@ value_t convert_command(call_scope_t& args)
foreach (post_t * post, xact->posts)
post->amount.in_place_negate();
}
-
+
bool matched = false;
if (! xact->posts.front()->amount.is_null()) {
post_map_t::iterator i = post_map.find(- xact->posts.front()->amount);
@@ -121,14 +121,10 @@ value_t convert_command(call_scope_t& args)
}
else {
if (xact->posts.front()->account == NULL) {
- xacts_iterator xi;
- xi.xacts_i = current_xacts.begin();
- xi.xacts_end = current_xacts.end();
- xi.xacts_uninitialized = false;
-
// jww (2010-03-07): Bind this logic to an option: --auto-match
if (account_t * acct =
- lookup_probable_account(xact->payee, xi, bucket).second)
+ lookup_probable_account(xact->payee, current_xacts.rbegin(),
+ current_xacts.rend(), bucket).second)
xact->posts.front()->account = acct;
else
xact->posts.front()->account = unknown;
@@ -141,7 +137,7 @@ value_t convert_command(call_scope_t& args)
}
else {
xact_posts_iterator xact_iter(*xact);
- while (post_t * post = xact_iter())
+ while (post_t * post = *xact_iter++)
formatter(*post);
}
}