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. --- walk.h | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'walk.h') diff --git a/walk.h b/walk.h index c92366e0..7984e62c 100644 --- a/walk.h +++ b/walk.h @@ -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& 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& entries_list) { - for (std::list::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 -- cgit v1.2.3