summaryrefslogtreecommitdiff
path: root/src/convert.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2011-07-19 23:29:31 -0500
committerJohn Wiegley <johnw@newartisans.com>2011-07-19 23:29:31 -0500
commit966b6fc359bacad6b22e79fd5afbec0ea80e8d6a (patch)
tree324ed3f2e18bed15952cc60dc92e31fc6f8ec43c /src/convert.cc
parentd0dfff62a6a3a685f19a5bed8716f7b661dc8c60 (diff)
downloadfork-ledger-966b6fc359bacad6b22e79fd5afbec0ea80e8d6a.tar.gz
fork-ledger-966b6fc359bacad6b22e79fd5afbec0ea80e8d6a.tar.bz2
fork-ledger-966b6fc359bacad6b22e79fd5afbec0ea80e8d6a.zip
Lookup probable accounts in reverse historical order
Fixes #510
Diffstat (limited to 'src/convert.cc')
-rw-r--r--src/convert.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/convert.cc b/src/convert.cc
index 5d3f23fa..3a9a143d 100644
--- a/src/convert.cc
+++ b/src/convert.cc
@@ -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;