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 /account.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 'account.cc')
-rw-r--r-- | account.cc | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -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; } |