diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2013-04-01 15:41:02 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2013-04-01 15:41:02 +0200 |
commit | b8a884c0c7d5f670179a82984289140a9f432729 (patch) | |
tree | b13a8ede63005d5bbd7be6e45a9a734c4c6a2403 /apt-pkg | |
parent | 40befb065d110c7b3a7b3d37759b6888522817b2 (diff) |
equal comparisions are used mostly in same-source relations,
so use this to try to reuse some version strings
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/pkgcachegen.cc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 01aaf6164..b11ddcf9e 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -864,12 +864,20 @@ bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg, map_ptrloc index = 0; if (Version.empty() == false) { - void const * const oldMap = Map.Data(); - index = WriteStringInMap(Version); - if (unlikely(index == 0)) - return false; - if (oldMap != Map.Data()) - OldDepLast += (map_ptrloc*) Map.Data() - (map_ptrloc*) oldMap; + int const CmpOp = Op & 0x0F; + // =-deps are used (79:1) for lockstep on same-source packages (e.g. data-packages) + if (CmpOp == pkgCache::Dep::Equals && strcmp(Version.c_str(), Ver.VerStr()) == 0) + index = Ver->VerStr; + + if (index == 0) + { + void const * const oldMap = Map.Data(); + index = WriteStringInMap(Version); + if (unlikely(index == 0)) + return false; + if (oldMap != Map.Data()) + OldDepLast += (map_ptrloc*) Map.Data() - (map_ptrloc*) oldMap; + } } return NewDepends(Pkg, Ver, index, Op, Type, OldDepLast); } |