]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/deblistparser.cc
ParseDepends: Mark branches for build-dep parsing as unlikely
[apt.git] / apt-pkg / deb / deblistparser.cc
index 85bddcd10d7902f8d48fdba1d9cde3c11b486cd8..874a94e24de1869e6bd9fd2860e4298ab59c66f8 100644 (file)
@@ -284,8 +284,10 @@ MD5SumValue debListParser::Description_md5()
    }
    else if (likely(value.size() == 32))
    {
-      if (likely(value.find_first_not_of("0123456789abcdefABCDEF") == string::npos))
-        return MD5SumValue(value);
+      MD5SumValue sumvalue;
+      if (sumvalue.Set(value))
+        return sumvalue;
+
       _error->Error("Malformed Description-md5 line; includes invalid character '%s'", value.c_str());
       return MD5SumValue();
    }
@@ -607,7 +609,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
    // Skip whitespace
    for (;I != Stop && isspace_ascii(*I) != 0; I++);
 
-   if (ParseArchFlags == true)
+   if (unlikely(ParseArchFlags == true))
    {
       string const arch = _config->Find("APT::Architecture");
       APT::CacheFilter::PackageArchitectureMatchesSpecification matchesArch(arch, false);
@@ -667,7 +669,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
       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:
       // (foo AND bar) OR (blub AND bla)