From 6048ae7c05622a83355ad0a87ab1ce512f00b3f3 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 5 Aug 2004 23:51:20 -0400 Subject: fixed cache by clear transaction flags before writing --- walk.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'walk.h') diff --git a/walk.h b/walk.h index 2bc578a1..2cc6f2e3 100644 --- a/walk.h +++ b/walk.h @@ -164,6 +164,31 @@ void walk_entries(entries_list::iterator begin, handle_transaction(*j, functor, disp_pred_functor, flags); } +template +void walk_entries(entries_list::iterator begin, + entries_list::iterator end, Function functor) +{ + for (entries_list::iterator i = begin; i != end; i++) + for (transactions_list::iterator j = (*i)->transactions.begin(); + j != (*i)->transactions.end(); + j++) + functor(*j); +} + +class clear_flags +{ + public: + void operator()(transaction_t * xact) const { + xact->flags &= ~(TRANSACTION_HANDLED | TRANSACTION_DISPLAYED); + } +}; + +inline void clear_transaction_display_flags(entries_list::iterator begin, + entries_list::iterator end) +{ + walk_entries(begin, end, clear_flags()); +} + template void walk_transactions(transactions_list::iterator begin, transactions_list::iterator end, Function functor) -- cgit v1.2.3