Prechádzať zdrojové kódy

init the pkgTagFile with the size of the Release file

Release files are basically one big Section, so we might safe some
Resize circles by starting with the filesize.

Git-Dch: Ignore
David Kalnischkies 13 rokov pred
rodič
commit
233d79a51c
2 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 1 1
      apt-pkg/deb/deblistparser.cc
  2. 1 1
      apt-pkg/indexrecords.cc

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

@@ -805,7 +805,7 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,
    map_ptrloc const storage = WriteUniqString(component);
    map_ptrloc const storage = WriteUniqString(component);
    FileI->Component = storage;
    FileI->Component = storage;
 
 
-   pkgTagFile TagFile(&File);
+   pkgTagFile TagFile(&File, File.Size());
    pkgTagSection Section;
    pkgTagSection Section;
    if (_error->PendingError() == true || TagFile.Step(Section) == false)
    if (_error->PendingError() == true || TagFile.Step(Section) == false)
       return false;
       return false;

+ 1 - 1
apt-pkg/indexrecords.cc

@@ -62,7 +62,7 @@ bool indexRecords::Load(const string Filename)				/*{{{*/
    if (OpenMaybeClearSignedFile(Filename, Fd) == false)
    if (OpenMaybeClearSignedFile(Filename, Fd) == false)
       return false;
       return false;
 
 
-   pkgTagFile TagFile(&Fd);
+   pkgTagFile TagFile(&Fd, Fd.Size());
    if (_error->PendingError() == true)
    if (_error->PendingError() == true)
    {
    {
       strprintf(ErrorText, _("Unable to parse Release file %s"),Filename.c_str());
       strprintf(ErrorText, _("Unable to parse Release file %s"),Filename.c_str());