summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/debversion.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/apt-pkg/deb/debversion.cc b/apt-pkg/deb/debversion.cc
index 94d357846..140561262 100644
--- a/apt-pkg/deb/debversion.cc
+++ b/apt-pkg/deb/debversion.cc
@@ -217,16 +217,12 @@ bool debVersioningSystem::CheckDep(const char *PkgVer,
return false;
Op &= 0x0F;
- size_t const lenPkgVer = strlen(PkgVer);
- size_t const lenDepVer = strlen(DepVer);
-
- // take a shortcut for equals which are string-equal as well
- if (Op == pkgCache::Dep::Equals && lenPkgVer == lenDepVer &&
- memcmp(PkgVer, DepVer, lenPkgVer) == 0)
- return true;
+ // 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 const Res = DoCmpVersion(PkgVer, PkgVer + lenPkgVer, DepVer, DepVer + lenDepVer);
+ int const Res = CmpVersion(PkgVer, DepVer);
switch (Op)
{
case pkgCache::Dep::LessEq: