summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/debversion.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2013-04-30 10:44:16 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2013-04-30 10:44:16 +0200
commit3599bca5211077f5456a40adb5cec1bcbee8c3ae (patch)
tree221627b7ef4e3d6d294fbaaab425f2400734bd93 /apt-pkg/deb/debversion.cc
parent6029901a2cf49aac035590960d84572b56f28933 (diff)
parentb5595da902e62af7c295f1603ae5b43ba4cef281 (diff)
merged from the debian-sid branch
Diffstat (limited to 'apt-pkg/deb/debversion.cc')
-rw-r--r--apt-pkg/deb/debversion.cc11
1 files changed, 8 insertions, 3 deletions
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)