From 966b6fc359bacad6b22e79fd5afbec0ea80e8d6a Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 19 Jul 2011 23:29:31 -0500 Subject: Lookup probable accounts in reverse historical order Fixes #510 --- src/lookup.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/lookup.cc') 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 -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) -- cgit v1.2.3