diff options
author | John Wiegley <johnw@newartisans.com> | 2011-07-19 23:29:31 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2011-07-19 23:29:31 -0500 |
commit | 966b6fc359bacad6b22e79fd5afbec0ea80e8d6a (patch) | |
tree | 324ed3f2e18bed15952cc60dc92e31fc6f8ec43c /src/lookup.cc | |
parent | d0dfff62a6a3a685f19a5bed8716f7b661dc8c60 (diff) | |
download | fork-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/lookup.cc')
-rw-r--r-- | src/lookup.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lookup.cc b/src/lookup.cc index 221397ca..28007d9a 100644 --- a/src/lookup.cc +++ b/src/lookup.cc @@ -60,9 +60,10 @@ namespace { } std::pair<xact_t *, account_t *> -lookup_probable_account(const string& ident, - xacts_iterator& iter_func, - account_t * ref_account) +lookup_probable_account(const string& ident, + xacts_list::reverse_iterator iter, + xacts_list::reverse_iterator end, + account_t * ref_account) { scorecard_t scores; @@ -83,7 +84,8 @@ lookup_probable_account(const string& ident, " with reference account: " << ref_account->fullname()); #endif - while (xact_t * xact = iter_func()) { + xact_t * xact; + while (iter != end && (xact = *iter++) != NULL) { #if 0 // Only consider transactions from the last two years (jww (2010-03-07): // make this an option) |