summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/deb/debrecords.cc14
-rw-r--r--apt-pkg/deb/debrecords.h3
2 files changed, 14 insertions, 3 deletions
diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc
index b9d1b6e2f..438b147bd 100644
--- a/apt-pkg/deb/debrecords.cc
+++ b/apt-pkg/deb/debrecords.cc
@@ -31,9 +31,13 @@
using std::string;
+struct debRecordParser::Private {
+ unsigned long long Offset = -1;
+};
+
// RecordParser::debRecordParser - Constructor /*{{{*/
debRecordParser::debRecordParser(string FileName,pkgCache &Cache) :
- debRecordParserBase(), d(NULL), File(FileName, FileFd::ReadOnly, FileFd::Extension),
+ debRecordParserBase(), d(new Private), File(FileName, FileFd::ReadOnly, FileFd::Extension),
Tags(&File, std::max(Cache.Head().MaxVerFileSize, Cache.Head().MaxDescFileSize) + 200)
{
}
@@ -41,18 +45,24 @@ 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() {}
+debRecordParser::~debRecordParser() { delete d; }
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 10ef91768..d81bdf08f 100644
--- a/apt-pkg/deb/debrecords.h
+++ b/apt-pkg/deb/debrecords.h
@@ -53,7 +53,8 @@ class APT_HIDDEN debRecordParserBase : public pkgRecords::Parser
class APT_HIDDEN debRecordParser : public debRecordParserBase
{
- void * const d;
+ struct Private;
+ Private *d;
protected:
FileFd File;
pkgTagFile Tags;