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. --- reconcile.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'reconcile.cc') diff --git a/reconcile.cc b/reconcile.cc index b3f53483..12b66c8c 100644 --- a/reconcile.cc +++ b/reconcile.cc @@ -40,19 +40,17 @@ void reconcile_xacts::flush() xact_t * first = NULL; xact_t ** last_ptr = &first; - for (xacts_list::iterator x = xacts.begin(); - x != xacts.end(); - x++) { - if (! is_valid(cutoff) || (*x)->date() < cutoff) { - switch ((*x)->state) { + foreach (xact_t * xact, xacts) { + if (! is_valid(cutoff) || xact->date() < cutoff) { + switch (xact->state) { case xact_t::CLEARED: - cleared_balance += (*x)->amount; + cleared_balance += xact->amount; break; case xact_t::UNCLEARED: case xact_t::PENDING: - pending_balance += (*x)->amount; - *last_ptr = *x; - last_ptr = xact_next_ptr(*x); + pending_balance += xact->amount; + *last_ptr = xact; + last_ptr = xact_next_ptr(xact); break; } } -- cgit v1.2.3