summaryrefslogtreecommitdiff
path: root/apt-pkg/srcrecords.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-01-29 23:24:41 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-01-30 00:16:20 +0100
commit6a9c9d63edc878ff268cdaa4f985ca50c48380b0 (patch)
treecf4f6c357c50e386b1824dd155ef3edbff4f188c /apt-pkg/srcrecords.cc
parente62aa1dd8099aeb8bb667253ca22c56b93f521d1 (diff)
restart debSrcRecordParsers only if needed
The offset variable in DebSrcRecordParser was not initialized which we now do and based on it do not trigger a restart if the parser was not used yet avoiding a needless rescan of the section. Detected while working on the previous commit e62aa1dd. Both commits act as a "fix" for the bug shown in the testcase of the commit – this one here would only hide it through.
Diffstat (limited to 'apt-pkg/srcrecords.cc')
-rw-r--r--apt-pkg/srcrecords.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc
index 297559957..60b62850a 100644
--- a/apt-pkg/srcrecords.cc
+++ b/apt-pkg/srcrecords.cc
@@ -70,8 +70,9 @@ bool pkgSrcRecords::Restart()
Current = Files.begin();
for (std::vector<Parser*>::iterator I = Files.begin();
I != Files.end(); ++I)
- (*I)->Restart();
-
+ if ((*I)->Offset() != 0)
+ (*I)->Restart();
+
return true;
}
/*}}}*/