X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/37adedc9d0b66eeae7efb88aebd08dfbc6e06f77..8c9c50f94768a13359b108e2cd0da9832f9cf6ad:/apt-pkg/deb/debversion.cc diff --git a/apt-pkg/deb/debversion.cc b/apt-pkg/deb/debversion.cc index a02699a44..140561262 100644 --- a/apt-pkg/deb/debversion.cc +++ b/apt-pkg/deb/debversion.cc @@ -215,10 +215,15 @@ bool debVersioningSystem::CheckDep(const char *PkgVer, return true; if (PkgVer == 0 || PkgVer[0] == 0) return false; - + Op &= 0x0F; + + // fast track for (equal) strings [by location] which are by definition equal versions + if (PkgVer == DepVer) + return Op == pkgCache::Dep::Equals || Op == pkgCache::Dep::LessEq || Op == pkgCache::Dep::GreaterEq; + // Perform the actual comparision. - int Res = CmpVersion(PkgVer,DepVer); - switch (Op & 0x0F) + int const Res = CmpVersion(PkgVer, DepVer); + switch (Op) { case pkgCache::Dep::LessEq: if (Res <= 0)