Author: matz
Date: Sun Nov 25 21:10:12 2007
New Revision: 7917
URL: http://svn.opensuse.org/viewcvs/zypp?rev=7917&view=rev
Log:
Edition and Capability are now Id based --> fast ctor --> no need for
a complicated map<> to cache anymore.
Modified:
branches/use-solv/libzypp/zypp/repo/cached/RepoImpl.cc
branches/use-solv/libzypp/zypp/target/rpm/RpmDb.cc
Modified: branches/use-solv/libzypp/zypp/repo/cached/RepoImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/use-solv/libzypp/zypp/repo/cached/RepoImpl.cc?rev=7917&r1=7916&r2=7917&view=diff
==============================================================================
--- branches/use-solv/libzypp/zypp/repo/cached/RepoImpl.cc (original)
+++ branches/use-solv/libzypp/zypp/repo/cached/RepoImpl.cc Sun Nov 25 21:10:12 2007
@@ -155,8 +155,6 @@
return ResTraits<Package>::kind;
}
-map id2cap;
-map id2ed;
static const Rel flag2rel[8] = {
Rel::NONE,
Rel::GT,
@@ -176,18 +174,7 @@
return;
ids = repo->idarraydata + ofs;
while((id = *ids++) != 0)
- {
- if (id2cap.find(id) != id2cap.end())
- {
- caps.insert (id2cap[id]);
- }
- else
- {
- Capability cap = factory.fromId(id);
- id2cap[id] = cap;
- caps.insert (cap);
- }
- }
+ caps.insert (factory.fromId (id));
}
void RepoImpl::createResFromRepo()
@@ -204,15 +191,7 @@
Resolvable::Kind kind;
Edition ed;
const char *name = id2str (pool, s->name);
- if (id2ed.find (s->evr) != id2ed.end())
- ed = id2ed[s->evr];
- else
- {
- /* ??? catch exception here? */
- /* XXX Edition ctor does a regexp if given a string :( */
- ed = Edition (s->evr);
- id2ed[s->evr] = ed;
- }
+ ed = Edition (s->evr);
NVRAD nvrad ( name,
ed,
/* XXX Arch needs to become Id based. */
@@ -232,7 +211,6 @@
kind = kind_for_name (name, s->arch);
insertNVRAD (id, kind, nvrad);
}
- //id2cap.clear();
}
void RepoImpl::createResolvables()
Modified: branches/use-solv/libzypp/zypp/target/rpm/RpmDb.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/use-solv/libzypp/zypp/target/rpm/RpmDb.cc?rev=7917&r1=7916&r2=7917&view=diff
==============================================================================
--- branches/use-solv/libzypp/zypp/target/rpm/RpmDb.cc (original)
+++ branches/use-solv/libzypp/zypp/target/rpm/RpmDb.cc Sun Nov 25 21:10:12 2007
@@ -1323,8 +1323,6 @@
return ResTraits<Package>::kind;
}
-map id2cap;
-map id2ed;
static const Rel flag2rel[8] = {
Rel::NONE,
Rel::GT,
@@ -1344,18 +1342,7 @@
return;
ids = repo->idarraydata + ofs;
while((id = *ids++) != 0)
- {
- if (id2cap.find(id) != id2cap.end())
- {
- caps.insert (id2cap[id]);
- }
- else
- {
- Capability cap = factory.fromId(id);
- id2cap[id] = cap;
- caps.insert (cap);
- }
- }
+ caps.insert (factory.fromId (id));
}
const listPackage::Ptr & RpmDb::doGetPackages(callback::SendReport<ScanDBReport> & report)
@@ -1394,15 +1381,7 @@
Resolvable::Kind kind;
Edition ed;
const char *name = id2str (the_pool, s->name);
- if (id2ed.find (s->evr) != id2ed.end())
- ed = id2ed[s->evr];
- else
- {
- /* ??? catch exception here? */
- /* XXX Edition ctor does a regexp if given a string :( */
- ed = Edition (s->evr);
- id2ed[s->evr] = ed;
- }
+ ed = Edition (s->evr);
NVRAD nvrad ( name,
ed,
/* XXX Arch needs to become Id based. */
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org