diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2024-03-21 22:18:58 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2024-03-22 11:10:24 +0100 |
commit | c8641c40d1a67408439c3a3a37ea203b838eb21a (patch) | |
tree | bf0bdaa4d405dfda6e527d11ad027ca8d90aeba5 /apt-pkg | |
parent | 5414789489f9814aaacdc6169975bae1b871a44f (diff) |
Revert "debrecords: Do not reparse if given same location"
This reverts commit 9bb953fddae0246a4dcedddb769d75d3521e1f2f.
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/deb/debrecords.cc | 14 | ||||
-rw-r--r-- | apt-pkg/deb/debrecords.h | 3 |
2 files changed, 3 insertions, 14 deletions
diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc index 438b147bd..b9d1b6e2f 100644 --- a/apt-pkg/deb/debrecords.cc +++ b/apt-pkg/deb/debrecords.cc @@ -31,13 +31,9 @@ using std::string; -struct debRecordParser::Private { - unsigned long long Offset = -1; -}; - // RecordParser::debRecordParser - Constructor /*{{{*/ debRecordParser::debRecordParser(string FileName,pkgCache &Cache) : - debRecordParserBase(), d(new Private), File(FileName, FileFd::ReadOnly, FileFd::Extension), + debRecordParserBase(), d(NULL), File(FileName, FileFd::ReadOnly, FileFd::Extension), Tags(&File, std::max(Cache.Head().MaxVerFileSize, Cache.Head().MaxDescFileSize) + 200) { } @@ -45,24 +41,18 @@ debRecordParser::debRecordParser(string FileName,pkgCache &Cache) : // RecordParser::Jump - Jump to a specific record /*{{{*/ bool debRecordParser::Jump(pkgCache::VerFileIterator const &Ver) { - if (d->Offset == Ver->Offset) - return true; if (Ver.end() == true) return false; - d->Offset = Ver->Offset; return Tags.Jump(Section,Ver->Offset); } bool debRecordParser::Jump(pkgCache::DescFileIterator const &Desc) { - if (d->Offset == Desc->Offset) - return true; if (Desc.end() == true) return false; - d->Offset = Desc->Offset; return Tags.Jump(Section,Desc->Offset); } /*}}}*/ -debRecordParser::~debRecordParser() { delete d; } +debRecordParser::~debRecordParser() {} debRecordParserBase::debRecordParserBase() : Parser(), d(NULL) {} // RecordParserBase::FileName - Return the archive filename on the site /*{{{*/ diff --git a/apt-pkg/deb/debrecords.h b/apt-pkg/deb/debrecords.h index d81bdf08f..10ef91768 100644 --- a/apt-pkg/deb/debrecords.h +++ b/apt-pkg/deb/debrecords.h @@ -53,8 +53,7 @@ class APT_HIDDEN debRecordParserBase : public pkgRecords::Parser class APT_HIDDEN debRecordParser : public debRecordParserBase { - struct Private; - Private *d; + void * const d; protected: FileFd File; pkgTagFile Tags; |