aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-06-21 12:53:50 +0200
committerHenning Baldersheim <balder@oath.com>2018-06-21 12:53:50 +0200
commitabafcb8e25e96d7409c300e6a6dd4cd295e52707 (patch)
tree25c4ea82f4cdb8b2f173fb30c93df3bd663945be /searchcore
parent44820b516a16cda3e82ba7beab8e2fe5bd3f4831 (diff)
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;
}