diff options
author | Julian Andres Klode <jak@debian.org> | 2016-01-08 00:52:29 +0100 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2016-01-08 00:52:29 +0100 |
commit | 57590d3c6e6b055402c938c3baebf1d872c58f7e (patch) | |
tree | f7cf78187695a1820d0cd38d04eb69e5901e2533 /apt-pkg/deb/deblistparser.cc | |
parent | dd592790c8f1be4925f74266742c163516ab80c7 (diff) |
Replace compare() == 0 checks with this == other checks
This improves performance, as we now can ignore unequal strings
based on their length already.
Gbp-Dch: ignore
Diffstat (limited to 'apt-pkg/deb/deblistparser.cc')
-rw-r--r-- | apt-pkg/deb/deblistparser.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 6ab0d0393..bcfbcccc2 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -591,9 +591,9 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, string const arch = _config->Find("APT::Architecture"); size_t const found = Package.rfind(':'); if (found != StringView::npos && - (Package.compare(found, Package.size(), ":any") == 0 || - Package.compare(found, Package.size(), ":native") == 0|| - Package.compare(found +1, Package.size(), arch) == 0)) + (Package.substr(found) == ":any" || + Package.substr(found) == ":native" || + Package.substr(found +1) == arch)) Package = Package.substr(0,found); } @@ -827,7 +827,7 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver, if (NewDepends(Ver,Package,pkgArch,Version,Op,Type) == false) return false; } - else if (Package.compare(found, Package.npos, ":any") == 0) + else if (Package.substr(found) == ":any") { if (NewDepends(Ver,Package,"any",Version,Op,Type) == false) return false; |