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. --- account.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'account.cc') diff --git a/account.cc b/account.cc index 4a03e784..241ac097 100644 --- a/account.cc +++ b/account.cc @@ -37,10 +37,8 @@ account_t::~account_t() { TRACE_DTOR(account_t); - for (accounts_map::iterator i = accounts.begin(); - i != accounts.end(); - i++) - checked_delete((*i).second); + foreach (accounts_map::value_type& pair, accounts) + checked_delete(pair.second); } account_t * account_t::find_account(const string& name, @@ -130,15 +128,13 @@ bool account_t::valid() const return false; } - for (accounts_map::const_iterator i = accounts.begin(); - i != accounts.end(); - i++) { - if (this == (*i).second) { + foreach (const accounts_map::value_type& pair, accounts) { + if (this == pair.second) { DEBUG("ledger.validate", "account_t: parent refers to itself!"); return false; } - if (! (*i).second->valid()) { + if (! pair.second->valid()) { DEBUG("ledger.validate", "account_t: child not valid"); return false; } -- cgit v1.2.3