summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-05-10 18:32:06 +0200
committerJulian Andres Klode <jak@debian.org>2016-05-10 18:32:06 +0200
commita9c2517e9ce961a761022dfa8eb0b62f68f5df9e (patch)
treea60d49072c2b29d0d582b9b9e384932e48e67921 /apt-pkg
parent33190fe3d3c200dcd417cd336f9db11f5f4408d5 (diff)
parent326a2ecfa9c6fa9d6941d7133e698510d7355ded (diff)
Merge pull request julian-klode/apt#3 from adrian17/master
Improve GetLocalitySortedVersionSet, speeds up apt search by 30%
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/contrib/strutl.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index d388cbda3..24fca5174 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -71,14 +71,14 @@ bool Endswith(const std::string &s, const std::string &end)
{
if (end.size() > s.size())
return false;
- return (s.substr(s.size() - end.size(), s.size()) == end);
+ return (s.compare(s.size() - end.size(), end.size(), end) == 0);
}
bool Startswith(const std::string &s, const std::string &start)
{
if (start.size() > s.size())
return false;
- return (s.substr(0, start.size()) == start);
+ return (s.compare(0, start.size(), start) == 0);
}
}