X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/71ecaad29d8066a494f516efc5efd80860653fe2..f7feb041e8d8dac5fac3c6cd44c8108e12ea4cd6:/apt-pkg/deb/debversion.cc?ds=sidebyside diff --git a/apt-pkg/deb/debversion.cc b/apt-pkg/deb/debversion.cc index a02699a44..a5eacb7f5 100644 --- a/apt-pkg/deb/debversion.cc +++ b/apt-pkg/deb/debversion.cc @@ -15,6 +15,8 @@ #include #include +#include +#include #include #include /*}}}*/ @@ -116,7 +118,7 @@ int debVersioningSystem::CmpFragment(const char *A,const char *AEnd, return 1; } - // Shouldnt happen + // Shouldn't happen return 1; } /*}}}*/ @@ -215,10 +217,15 @@ bool debVersioningSystem::CheckDep(const char *PkgVer, return true; if (PkgVer == 0 || PkgVer[0] == 0) return false; - - // Perform the actual comparision. - int Res = CmpVersion(PkgVer,DepVer); - switch (Op & 0x0F) + 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 comparison. + int const Res = CmpVersion(PkgVer, DepVer); + switch (Op) { case pkgCache::Dep::LessEq: if (Res <= 0)