diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-06 20:39:58 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-06 20:39:58 +0200 |
commit | 6fa6ebe8dbc9f1910ea6d91dd6eea20f2c934f65 (patch) | |
tree | b2f070345f0adc9280daee6be68942e4286a386d /common/queryrunner.cpp | |
parent | 7b928b25454311ef5b52639a0a2d5d1afefa7cf8 (diff) | |
download | sink-6fa6ebe8dbc9f1910ea6d91dd6eea20f2c934f65.tar.gz sink-6fa6ebe8dbc9f1910ea6d91dd6eea20f2c934f65.zip |
Properly count replayed results.
We used to count one too many.
Diffstat (limited to 'common/queryrunner.cpp')
-rw-r--r-- | common/queryrunner.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/queryrunner.cpp b/common/queryrunner.cpp index 38fc779..b572d11 100644 --- a/common/queryrunner.cpp +++ b/common/queryrunner.cpp | |||
@@ -184,11 +184,11 @@ qint64 QueryWorker<DomainType>::replaySet(ResultSet &resultSet, Sink::ResultProv | |||
184 | { | 184 | { |
185 | Trace() << "Skipping over " << offset << " results"; | 185 | Trace() << "Skipping over " << offset << " results"; |
186 | resultSet.skip(offset); | 186 | resultSet.skip(offset); |
187 | int counter; | 187 | int counter = 0; |
188 | for (counter = 0; !batchSize || (counter < batchSize); counter++) { | 188 | while (!batchSize || (counter < batchSize)) { |
189 | const bool ret = | 189 | const bool ret = |
190 | resultSet.next([this, &resultProvider, &counter, &properties, batchSize](const Sink::ApplicationDomain::ApplicationDomainType::Ptr &value, Sink::Operation operation) -> bool { | 190 | resultSet.next([this, &resultProvider, &counter, &properties, batchSize](const Sink::ApplicationDomain::ApplicationDomainType::Ptr &value, Sink::Operation operation) -> bool { |
191 | // FIXME allow maildir resource to set the mimeMessage property | 191 | counter++; |
192 | auto valueCopy = Sink::ApplicationDomain::ApplicationDomainType::getInMemoryRepresentation<DomainType>(*value, properties).template staticCast<DomainType>(); | 192 | auto valueCopy = Sink::ApplicationDomain::ApplicationDomainType::getInMemoryRepresentation<DomainType>(*value, properties).template staticCast<DomainType>(); |
193 | if (mResultTransformation) { | 193 | if (mResultTransformation) { |
194 | mResultTransformation(*valueCopy); | 194 | mResultTransformation(*valueCopy); |