diff options
author | John Wiegley <johnw@newartisans.com> | 2008-07-31 17:48:29 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-07-31 17:48:29 -0400 |
commit | e5048ec71bf114c351c62844b7603893195df4d4 (patch) | |
tree | 4153105f62fc6a244811df3c2e34366344c25792 /reconcile.cc | |
parent | 99313ebc6c3779f692f9f1bd70cc69a236f5eb78 (diff) | |
download | fork-ledger-e5048ec71bf114c351c62844b7603893195df4d4.tar.gz fork-ledger-e5048ec71bf114c351c62844b7603893195df4d4.tar.bz2 fork-ledger-e5048ec71bf114c351c62844b7603893195df4d4.zip |
Change many uses of for+iterator to use Boost.Foreach.
Diffstat (limited to 'reconcile.cc')
-rw-r--r-- | reconcile.cc | 16 |
1 files changed, 7 insertions, 9 deletions
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; } } |