summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-06-21 13:32:29 +0200
committerGitHub <noreply@github.com>2018-06-21 13:32:29 +0200
commitd06d4a9c13bd33ad64009f35e462fdca473abc4f (patch)
tree97c53b943efa9542aa239ebf487a5b543b579149 /searchcore
parent9dff12a4aa4ab2e1bd688e02afd0d68f7e45d280 (diff)
parentabafcb8e25e96d7409c300e6a6dd4cd295e52707 (diff)
Merge pull request #6255 from vespa-engine/balder/invert-and-simplify
Invert the logic and simplify the loop.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/fdispatch/search/datasetcollection.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/datasetcollection.cpp b/searchcore/src/vespa/searchcore/fdispatch/search/datasetcollection.cpp
index ea981d1cc01..d99b32ac138 100644
--- a/searchcore/src/vespa/searchcore/fdispatch/search/datasetcollection.cpp
+++ b/searchcore/src/vespa/searchcore/fdispatch/search/datasetcollection.cpp
@@ -198,16 +198,13 @@ FastS_DataSetCollection::GetDataSet()
bool
FastS_DataSetCollection::AreEnginesReady()
{
- bool ready = true;
-
- for (uint32_t datasetidx = 0;
- ready && (datasetidx < GetMaxNumDataSets());
- datasetidx++)
- {
+ for (uint32_t datasetidx = 0; datasetidx < GetMaxNumDataSets(); datasetidx++) {
FastS_DataSetBase *dataset = PeekDataSet(datasetidx);
- ready = (dataset != nullptr && !dataset->AreEnginesReady());
+ if ((dataset != nullptr) && !dataset->AreEnginesReady()) {
+ return false;
+ }
}
- return ready;
+ return true;
}