ref: refs/heads/SuSE-Code-11-Branch
commit 9e5912b330ed071a9b2497ec1987648c12295c87
Author: Michael Andres
Date: Wed Feb 18 13:24:47 2009 +0100
Neither lose packages with empty name, nor SEGV when processing them. (bnc #470011)
---
zypp/ResPoolProxy.cc | 21 ++++++++-------------
1 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/zypp/ResPoolProxy.cc b/zypp/ResPoolProxy.cc
index 756481f..5753475 100644
--- a/zypp/ResPoolProxy.cc
+++ b/zypp/ResPoolProxy.cc
@@ -108,30 +108,25 @@ namespace zypp
const pool::PoolImpl::Id2ItemT & id2item( poolImpl_r.id2item() );
if ( ! id2item.empty() )
{
- sat::detail::IdType cidx = sat::detail::noId;
+ // set startpoint
pool::PoolImpl::Id2ItemT::const_iterator cbegin = id2item.begin();
for_( it, id2item.begin(), id2item.end() )
{
- sat::detail::IdType idx( it->first );
- if ( idx != cidx )
+ if ( it->first != cbegin->first )
{
- // starting a new Selectable
- if ( cidx )
- {
- // create the previous one
- ui::Selectable::Ptr p( makeSelectablePtr( cbegin, it ) );
- _selPool[p->kind()].push_back( p );
- _selIndex[cidx] = p;
- }
- cidx = idx;
+ // starting a new Selectable, create the previous one
+ ui::Selectable::Ptr p( makeSelectablePtr( cbegin, it ) );
+ _selPool[p->kind()].push_back( p );
+ _selIndex[cbegin->first] = p;
+ // remember new startpoint
cbegin = it;
}
}
// create the final one
ui::Selectable::Ptr p( makeSelectablePtr( cbegin, id2item.end() ) );
_selPool[p->kind()].push_back( p );
- _selIndex[cidx] = p;
+ _selIndex[cbegin->first] = p;
}
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org