summaryrefslogtreecommitdiff
path: root/account.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-31 17:48:29 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-31 17:48:29 -0400
commite5048ec71bf114c351c62844b7603893195df4d4 (patch)
tree4153105f62fc6a244811df3c2e34366344c25792 /account.cc
parent99313ebc6c3779f692f9f1bd70cc69a236f5eb78 (diff)
downloadfork-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.cc14
1 files changed, 5 insertions, 9 deletions
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;
}