Преглед изворни кода

ParseDepends: Mark branches for build-dep parsing as unlikely

We do not see those branches at all during normal mode of
operation (that is, during cache generation), so tell the
compiler about it.
Julian Andres Klode пре 10 година
родитељ
комит
1470416266
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      apt-pkg/deb/deblistparser.cc

+ 2 - 2
apt-pkg/deb/deblistparser.cc

@@ -609,7 +609,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
    // Skip whitespace
    // Skip whitespace
    for (;I != Stop && isspace_ascii(*I) != 0; I++);
    for (;I != Stop && isspace_ascii(*I) != 0; I++);
 
 
-   if (ParseArchFlags == true)
+   if (unlikely(ParseArchFlags == true))
    {
    {
       string const arch = _config->Find("APT::Architecture");
       string const arch = _config->Find("APT::Architecture");
       APT::CacheFilter::PackageArchitectureMatchesSpecification matchesArch(arch, false);
       APT::CacheFilter::PackageArchitectureMatchesSpecification matchesArch(arch, false);
@@ -669,7 +669,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
       for (;I != Stop && isspace_ascii(*I) != 0; I++);
       for (;I != Stop && isspace_ascii(*I) != 0; I++);
    }
    }
 
 
-   if (ParseRestrictionsList == true)
+   if (unlikely(ParseRestrictionsList == true))
    {
    {
       // Parse a restrictions formula which is in disjunctive normal form:
       // Parse a restrictions formula which is in disjunctive normal form:
       // (foo AND bar) OR (blub AND bla)
       // (foo AND bar) OR (blub AND bla)