From e5048ec71bf114c351c62844b7603893195df4d4 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 31 Jul 2008 17:48:29 -0400 Subject: Change many uses of for+iterator to use Boost.Foreach. --- derive.cc | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'derive.cc') diff --git a/derive.cc b/derive.cc index bcf8f8f3..03b05619 100644 --- a/derive.cc +++ b/derive.cc @@ -96,10 +96,8 @@ entry_t * derive_new_entry(report_t& report, // to see the same xact as last time. added->code = matching->code; - for (xacts_list::iterator k = matching->xacts.begin(); - k != matching->xacts.end(); - k++) - added->add_xact(new xact_t(**k)); + foreach (xact_t * xact, matching->xacts) + added->add_xact(new xact_t(*xact)); } else if ((*i)[0] == '-' || std::isdigit((*i)[0])) { xact_t * m_xact, * xact, * first; @@ -137,13 +135,10 @@ entry_t * derive_new_entry(report_t& report, for (; j != matching->journal->entries.rend(); j++) if (regexp.match((*j)->payee)) { entry_t * entry = *j; - for (xacts_list::const_iterator x = - entry->xacts.begin(); - x != entry->xacts.end(); - x++) - if (acct_regex.match((*x)->account->fullname())) { - acct = (*x)->account; - amt = &(*x)->amount; + foreach (xact_t * xact, entry->xacts) + if (acct_regex.match(xact->account->fullname())) { + acct = xact->account; + amt = &xact->amount; matching = entry; goto found; } -- cgit v1.2.3