ref: refs/heads/ma-tmp-pqt
commit 7da9893035f44ffd8d5d2338862eb50fb8d9d07c
Author: Michael Andres
Date: Tue Apr 14 15:26:25 2009 +0200
Get rid of memset/memcmp in dataiterator handling.
---
zypp/sat/LookupAttr.cc | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/zypp/sat/LookupAttr.cc b/zypp/sat/LookupAttr.cc
index 1bb4d54..8e85839 100644
--- a/zypp/sat/LookupAttr.cc
+++ b/zypp/sat/LookupAttr.cc
@@ -115,8 +115,6 @@ namespace zypp
#warning Need to call dataiterator_free, use Autodispose instead of scoped_ptr
scoped_ptr< ::_Dataiterator> dip( new ::Dataiterator );
- // needed while LookupAttr::iterator::dip_equal does ::memcmp:
- ::memset( dip.get(), 0, sizeof(::_Dataiterator) );
const char * m = 0;
int f = 0;
@@ -391,8 +389,6 @@ namespace zypp
// setup the new sub iterator
scoped_ptr< ::_Dataiterator> dip( new ::Dataiterator );
- // needed while LookupAttr::iterator::dip_equal does ::memcmp:
- ::memset( dip.get(), 0, sizeof(::_Dataiterator) );
::dataiterator_init( dip.get(), sat::Pool::instance().get(), 0, SOLVID_POS, 0, 0, 0 );
@@ -571,7 +567,9 @@ namespace zypp
///////////////////////////////////////////////////////////////////
LookupAttr::iterator::~iterator()
- {}
+ {
+
+ }
LookupAttr::iterator::iterator()
: iterator_adaptor_( 0 )
@@ -612,8 +610,9 @@ namespace zypp
bool LookupAttr::iterator::dip_equal( const ::_Dataiterator & lhs, const ::_Dataiterator & rhs ) const
{
- // requires ::memset in LookupAttr::begin
- return ::memcmp( &lhs, &rhs, sizeof(::_Dataiterator) ) == 0;
+ // Iterator equal is same position in same container.
+ // Here: same attribute in same solvable.
+ return( lhs.solvid == rhs.solvid && lhs.key->name == rhs.key->name );
}
detail::IdType LookupAttr::iterator::dereference() const
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org