From 46c3bcc8b8dc4e5ef2ec0fd2000e3977934d0bc9 Mon Sep 17 00:00:00 2001 From: Klaus Kaempf Date: Sun, 12 Mar 2006 20:25:01 +0000 Subject: [PATCH] don't copy() the info_ptr --- zypp/solver/detail/ResolverContext.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/zypp/solver/detail/ResolverContext.cc b/zypp/solver/detail/ResolverContext.cc index 19d848d..3cac4b8 100644 --- a/zypp/solver/detail/ResolverContext.cc +++ b/zypp/solver/detail/ResolverContext.cc @@ -1237,10 +1237,16 @@ ResolverContext::foreachInfo (PoolItem_Ref item, int priority, ResolverInfoFn fn ResolverContext_constPtr context = this; // Assemble a list of copies of all of the info objects while (context != NULL) { + for (ResolverInfoList::const_iterator iter = context->_log.begin(); iter != context->_log.end(); iter++) { - if ((item == PoolItem_Ref() || (*iter)->affected() == item) - && (*iter)->priority() >= priority) { - info_list.push_back ((*iter)->copy()); + + ResolverInfo_Ptr info = *iter; + + if ((item == PoolItem_Ref() + || info->affected() == item) + && info->priority() >= priority) + { + info_list.push_back( info ); } } context = context->_parent; @@ -1261,13 +1267,13 @@ ResolverContext::foreachInfo (PoolItem_Ref item, int priority, ResolverInfoFn fn } } #endif - mark_important_info (info_list); + mark_important_info( info_list ); // Walk across the list of info objects and invoke our callback for (ResolverInfoList::iterator iter = info_list.begin(); iter != info_list.end(); iter++) { if (*iter != NULL) { - fn (*iter, data); + fn( *iter, data ); } } } -- 2.7.4