https://bugzilla.novell.com/show_bug.cgi?id=421588
User ma@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=421588#c7
Michael Andres changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |ASSIGNED
Info Provider|ma@novell.com |
--- Comment #7 from Michael Andres 2008-10-06 07:23:57 MDT ---
Using byIdent iterator should be fast enough, as there's an index for it.
- But 'pool.byIdentBegin(installed)' would be sufficient to construct the
iterator.
- PoolItemGetter does a common task, it picks the first match and stores it in
a variable. I templated it and slightly rewrote it to get rid of the functorRef
stuff. It's now in available in libzypp as functor::getFirst.
- I also added filter::SameItemAs to libzypp, to encapsulate the 'is the same'
package condition (it also includes a vendor check).
Your code could look like this:
PoolItem findInstalledItemInRepos( const PoolItem & installed)
{
zypp::ResPool pool(zypp::ResPool::instance());
PoolItem result;
invokeOnEach( pool.byIdentBegin(installed), pool.byIdentEnd(installed),
filter::SameItemAs( installed ),
functor::getFirst( result ) );
return result;
}
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.