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 /walk.h | |
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 'walk.h')
-rw-r--r-- | walk.h | 21 |
1 files changed, 7 insertions, 14 deletions
@@ -101,8 +101,7 @@ struct xact_xdata_t : public noncopyable datetime_t date; account_t * account; void * ptr; - - xacts_list * component_xacts; + xacts_list * component_xacts; xact_xdata_t() : index(0), dflags(0), @@ -126,17 +125,13 @@ struct xact_xdata_t : public noncopyable } void copy_component_xacts(xacts_list& xacts) { - for (xacts_list::const_iterator i = xacts.begin(); - i != xacts.end(); - i++) - remember_xact(**i); + foreach (xact_t * xact, xacts) + remember_xact(*xact); } void walk_component_xacts(item_handler<xact_t>& handler) const { - for (xacts_list::const_iterator i = component_xacts->begin(); - i != component_xacts->end(); - i++) - handler(**i); + foreach (xact_t * xact, *component_xacts) + handler(*xact); } }; @@ -493,10 +488,8 @@ public: }; inline void clear_entries_xacts(std::list<entry_t>& entries_list) { - for (std::list<entry_t>::iterator i = entries_list.begin(); - i != entries_list.end(); - i++) - (*i).xacts.clear(); + foreach (entry_t& entry, entries_list) + entry.xacts.clear(); } class collapse_xacts : public item_handler<xact_t> |