summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-03-29 16:35:04 +0300
committerGitHub <noreply@github.com>2019-03-29 16:35:04 +0300
commit82e1cef65155dc61652fdbdfdca66208c4118760 (patch)
treed37667118a237b30186c241f821c68617db9afa6
parenta5125dc0c668ceb3ae38d1b5b200f19071025330 (diff)
parentb4a0ae92dba7fc35c957f74fb941332a4abcbf4f (diff)
Merge pull request #8950 from vespa-engine/balder/inline-frequent-small-methods
Balder/inline frequent small methods
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/document_scorer.cpp7
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributeiterators.cpp41
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributeiterators.h26
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributeiterators.hpp1
-rw-r--r--searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp1
-rw-r--r--searchlib/src/vespa/searchlib/features/flow_completeness_feature.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/features/nativerankfeature.h1
-rw-r--r--searchlib/src/vespa/searchlib/features/term_field_md_feature.cpp18
-rw-r--r--searchlib/src/vespa/searchlib/fef/blueprint.cpp12
-rw-r--r--searchlib/src/vespa/searchlib/fef/blueprintresolver.cpp10
-rw-r--r--searchlib/src/vespa/searchlib/fef/matchdatalayout.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/fef/rank_program.cpp1
-rw-r--r--searchlib/src/vespa/searchlib/fef/termfieldmatchdata.cpp25
-rw-r--r--searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h20
-rw-r--r--searchlib/src/vespa/searchlib/fef/test/plugin/double.cpp9
-rw-r--r--searchlib/src/vespa/searchlib/fef/utils.cpp7
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/field_spec.cpp7
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/searchiterator.cpp12
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/searchiterator.h8
19 files changed, 87 insertions, 127 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/document_scorer.cpp b/searchcore/src/vespa/searchcore/proton/matching/document_scorer.cpp
index 81ac1f923b9..c7721b428b9 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/document_scorer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/document_scorer.cpp
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "document_scorer.h"
+#include <cassert>
using search::feature_t;
using search::fef::FeatureResolver;
@@ -8,8 +9,7 @@ using search::fef::RankProgram;
using search::fef::LazyValue;
using search::queryeval::SearchIterator;
-namespace proton {
-namespace matching {
+namespace proton::matching {
namespace {
@@ -36,5 +36,4 @@ DocumentScorer::score(uint32_t docId)
return doScore(docId);
}
-} // namespace proton::matching
-} // namespace proton
+}
diff --git a/searchlib/src/vespa/searchlib/attribute/attributeiterators.cpp b/searchlib/src/vespa/searchlib/attribute/attributeiterators.cpp
index 3f86a7f57db..ea3b4c2f32d 100644
--- a/searchlib/src/vespa/searchlib/attribute/attributeiterators.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/attributeiterators.cpp
@@ -8,13 +8,6 @@ namespace search {
using queryeval::MinMaxPostingInfo;
using fef::TermFieldMatchData;
-AttributeIteratorBase::AttributeIteratorBase(const attribute::ISearchContext &baseSearchCtx,
- TermFieldMatchData *matchData)
- : _baseSearchCtx(baseSearchCtx),
- _matchData(matchData),
- _matchPosition(_matchData->populate_fixed())
-{ }
-
void
AttributeIteratorBase::visitMembers(vespalib::ObjectVisitor &visitor) const
{
@@ -23,13 +16,6 @@ AttributeIteratorBase::visitMembers(vespalib::ObjectVisitor &visitor) const
visit(visitor, "tfmd.docId", _matchData->getDocId());
}
-FilterAttributeIterator::FilterAttributeIterator(const attribute::ISearchContext &baseSearchCtx,
- fef::TermFieldMatchData *matchData)
- : AttributeIteratorBase(baseSearchCtx, matchData)
-{
- _matchPosition->setElementWeight(1);
-}
-
void
AttributeIterator::visitMembers(vespalib::ObjectVisitor &visitor) const
{
@@ -37,27 +23,12 @@ AttributeIterator::visitMembers(vespalib::ObjectVisitor &visitor) const
visit(visitor, "weight", _weight);
}
-
void
FlagAttributeIterator::doUnpack(uint32_t docId)
{
_matchData->resetOnlyDocId(docId);
}
-AttributePostingListIterator::AttributePostingListIterator(const attribute::ISearchContext &baseSearchCtx,
- bool hasWeight,
- TermFieldMatchData *matchData)
- : AttributeIteratorBase(baseSearchCtx, matchData),
- _hasWeight(hasWeight)
-{
-}
-
-FilterAttributePostingListIterator::
-FilterAttributePostingListIterator(const attribute::ISearchContext &baseSearchCtx, TermFieldMatchData *matchData)
- : AttributeIteratorBase(baseSearchCtx, matchData)
-{
-}
-
void
AttributeIterator::doUnpack(uint32_t docId)
{
@@ -65,7 +36,6 @@ AttributeIterator::doUnpack(uint32_t docId)
_matchPosition->setElementWeight(_weight);
}
-
void
FilterAttributeIterator::doUnpack(uint32_t docId)
{
@@ -81,7 +51,6 @@ doUnpack(uint32_t docId)
_matchPosition->setElementWeight(getWeight());
}
-
template <>
void
AttributePostingListIteratorT<WeightedInnerAttributePostingListIterator>::
@@ -91,7 +60,6 @@ doUnpack(uint32_t docId)
_matchPosition->setElementWeight(getWeight());
}
-
template <>
void
FilterAttributePostingListIteratorT<InnerAttributePostingListIterator>::
@@ -100,7 +68,6 @@ doUnpack(uint32_t docId)
_matchData->resetOnlyDocId(docId);
}
-
template <>
void
FilterAttributePostingListIteratorT<WeightedInnerAttributePostingListIterator>::
@@ -109,7 +76,6 @@ doUnpack(uint32_t docId)
_matchData->resetOnlyDocId(docId);
}
-
template <>
void
AttributePostingListIteratorT<InnerAttributePostingListIterator>::
@@ -121,7 +87,6 @@ setupPostingInfo()
}
}
-
template <>
void
AttributePostingListIteratorT<WeightedInnerAttributePostingListIterator>::
@@ -134,7 +99,6 @@ setupPostingInfo()
}
}
-
template <>
void
AttributePostingListIteratorT<DocIdMinMaxIterator<AttributePosting> >::
@@ -146,7 +110,6 @@ setupPostingInfo()
}
}
-
template <>
void
AttributePostingListIteratorT<DocIdMinMaxIterator<AttributeWeightPosting> >::
@@ -170,7 +133,6 @@ setupPostingInfo()
}
}
-
template <>
void
FilterAttributePostingListIteratorT<WeightedInnerAttributePostingListIterator>::
@@ -182,7 +144,6 @@ setupPostingInfo()
}
}
-
template <>
void
FilterAttributePostingListIteratorT<DocIdMinMaxIterator<AttributePosting> >::
@@ -194,7 +155,6 @@ setupPostingInfo()
}
}
-
template <>
void
FilterAttributePostingListIteratorT<DocIdMinMaxIterator<AttributeWeightPosting> >::
@@ -206,5 +166,4 @@ setupPostingInfo()
}
}
-
} // namespace search
diff --git a/searchlib/src/vespa/searchlib/attribute/attributeiterators.h b/searchlib/src/vespa/searchlib/attribute/attributeiterators.h
index 0fbcab03ec0..3f85c2a20fe 100644
--- a/searchlib/src/vespa/searchlib/attribute/attributeiterators.h
+++ b/searchlib/src/vespa/searchlib/attribute/attributeiterators.h
@@ -5,6 +5,7 @@
#include "dociditerator.h"
#include "postinglisttraits.h"
#include <vespa/searchlib/queryeval/searchiterator.h>
+#include <vespa/searchlib/fef/termfieldmatchdata.h>
namespace search {
@@ -29,12 +30,16 @@ protected:
template <typename SC>
std::unique_ptr<BitVector> get_hits(const SC & sc, uint32_t begin_id) const;
void visitMembers(vespalib::ObjectVisitor &visitor) const override;
- const attribute::ISearchContext &_baseSearchCtx;
- fef::TermFieldMatchData * _matchData;
+ const attribute::ISearchContext & _baseSearchCtx;
+ fef::TermFieldMatchData * _matchData;
fef::TermFieldMatchDataPosition * _matchPosition;
public:
- AttributeIteratorBase(const attribute::ISearchContext &baseSearchCtx, fef::TermFieldMatchData *matchData);
+ AttributeIteratorBase(const attribute::ISearchContext &baseSearchCtx, fef::TermFieldMatchData *matchData)
+ : _baseSearchCtx(baseSearchCtx),
+ _matchData(matchData),
+ _matchPosition(_matchData->populate_fixed())
+ { }
Trinary is_strict() const override { return Trinary::False; }
const attribute::ISearchContext *getAttributeSearchContext() const override { return &_baseSearchCtx; }
};
@@ -67,7 +72,11 @@ class FilterAttributeIterator : public AttributeIteratorBase
{
public:
FilterAttributeIterator(const attribute::ISearchContext &baseSearchCtx,
- fef::TermFieldMatchData *matchData);
+ fef::TermFieldMatchData *matchData)
+ : AttributeIteratorBase(baseSearchCtx, matchData)
+ {
+ _matchPosition->setElementWeight(1);
+ }
protected:
void doUnpack(uint32_t docId) override;
};
@@ -167,7 +176,10 @@ class AttributePostingListIterator : public AttributeIteratorBase
{
public:
AttributePostingListIterator(const attribute::ISearchContext &baseSearchCtx,
- bool hasWeight, fef::TermFieldMatchData *matchData);
+ bool hasWeight, fef::TermFieldMatchData *matchData)
+ : AttributeIteratorBase(baseSearchCtx, matchData),
+ _hasWeight(hasWeight)
+ {}
Trinary is_strict() const override { return Trinary::True; }
protected:
bool _hasWeight;
@@ -177,7 +189,9 @@ protected:
class FilterAttributePostingListIterator : public AttributeIteratorBase
{
public:
- FilterAttributePostingListIterator(const attribute::ISearchContext &baseSearchCtx, fef::TermFieldMatchData *matchData);
+ FilterAttributePostingListIterator(const attribute::ISearchContext &baseSearchCtx, fef::TermFieldMatchData *matchData)
+ : AttributeIteratorBase(baseSearchCtx, matchData)
+ {}
Trinary is_strict() const override { return Trinary::True; }
};
diff --git a/searchlib/src/vespa/searchlib/attribute/attributeiterators.hpp b/searchlib/src/vespa/searchlib/attribute/attributeiterators.hpp
index d1165ed20e1..caf6c028c4d 100644
--- a/searchlib/src/vespa/searchlib/attribute/attributeiterators.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/attributeiterators.hpp
@@ -5,7 +5,6 @@
#include "attributeiterators.h"
#include <vespa/searchlib/btree/btreenode.hpp>
#include <vespa/searchlib/btree/btreeiterator.hpp>
-#include <vespa/searchlib/fef/termfieldmatchdata.h>
#include <vespa/searchlib/fef/termfieldmatchdataposition.h>
#include <vespa/searchlib/query/queryterm.h>
#include <vespa/searchlib/common/bitvector.h>
diff --git a/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp b/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp
index 1d71fa9d47c..1622a87e733 100644
--- a/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp
+++ b/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp
@@ -5,6 +5,7 @@
#include <vespa/searchlib/fef/featurenamebuilder.h>
#include <vespa/searchlib/fef/properties.h>
#include <vespa/vespalib/locale/c.h>
+#include <cassert>
namespace search::features {
diff --git a/searchlib/src/vespa/searchlib/features/flow_completeness_feature.cpp b/searchlib/src/vespa/searchlib/features/flow_completeness_feature.cpp
index 871c53221c8..eda83b991bf 100644
--- a/searchlib/src/vespa/searchlib/features/flow_completeness_feature.cpp
+++ b/searchlib/src/vespa/searchlib/features/flow_completeness_feature.cpp
@@ -7,6 +7,8 @@
#include <vespa/searchlib/fef/indexproperties.h>
#include <vespa/vespalib/stllike/hash_map.h>
#include <vespa/vespalib/locale/c.h>
+#include <cassert>
+
#include <vespa/log/log.h>
LOG_SETUP(".features.flowcompleteness");
diff --git a/searchlib/src/vespa/searchlib/features/nativerankfeature.h b/searchlib/src/vespa/searchlib/features/nativerankfeature.h
index 3b8ddccaa1d..06088a06fc8 100644
--- a/searchlib/src/vespa/searchlib/features/nativerankfeature.h
+++ b/searchlib/src/vespa/searchlib/features/nativerankfeature.h
@@ -5,6 +5,7 @@
#include <vespa/searchlib/fef/blueprint.h>
#include <vespa/searchlib/fef/fieldtype.h>
#include <vespa/searchlib/fef/table.h>
+#include <cassert>
namespace search::features {
diff --git a/searchlib/src/vespa/searchlib/features/term_field_md_feature.cpp b/searchlib/src/vespa/searchlib/features/term_field_md_feature.cpp
index 8b0eecd9cff..a4ca8524140 100644
--- a/searchlib/src/vespa/searchlib/features/term_field_md_feature.cpp
+++ b/searchlib/src/vespa/searchlib/features/term_field_md_feature.cpp
@@ -6,24 +6,22 @@
#include <vespa/searchlib/fef/indexproperties.h>
#include <vespa/searchlib/fef/itablemanager.h>
#include <vespa/searchlib/fef/properties.h>
+#include <cassert>
using namespace search::fef;
-namespace search {
-namespace features {
+namespace search::features {
-
-TermFieldMdExecutor::TermFieldMdExecutor(const search::fef::IQueryEnvironment &env,
- uint32_t fieldId)
+TermFieldMdExecutor::TermFieldMdExecutor(const fef::IQueryEnvironment &env, uint32_t fieldId)
: _terms(),
_md(nullptr)
{
for (uint32_t i = 0; i < env.getNumTerms(); ++i) {
- const search::fef::ITermData *td = env.getTerm(i);
+ const fef::ITermData *td = env.getTerm(i);
assert(td != 0);
- const search::fef::ITermFieldData *tfd = td->lookupField(fieldId);
+ const fef::ITermFieldData *tfd = td->lookupField(fieldId);
if (tfd != 0) {
- assert(tfd->getHandle() != search::fef::IllegalHandle);
+ assert(tfd->getHandle() != fef::IllegalHandle);
_terms.push_back(std::make_pair(tfd->getHandle(), td->getWeight()));
}
}
@@ -113,6 +111,4 @@ TermFieldMdBlueprint::createExecutor(const IQueryEnvironment & env, vespalib::St
return stash.create<TermFieldMdExecutor>(env, _field->id());
}
-
-} // namespace features
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/fef/blueprint.cpp b/searchlib/src/vespa/searchlib/fef/blueprint.cpp
index 6e04ede5253..b4def052379 100644
--- a/searchlib/src/vespa/searchlib/fef/blueprint.cpp
+++ b/searchlib/src/vespa/searchlib/fef/blueprint.cpp
@@ -2,12 +2,12 @@
#include "blueprint.h"
#include "parametervalidator.h"
+#include <cassert>
#include <vespa/log/log.h>
LOG_SETUP(".fef.blueprint");
-namespace search {
-namespace fef {
+namespace search::fef {
const FeatureType &
Blueprint::defineInput(vespalib::stringref inName,
@@ -34,9 +34,7 @@ Blueprint::Blueprint(vespalib::stringref baseName)
{
}
-Blueprint::~Blueprint()
-{
-}
+Blueprint::~Blueprint() = default;
ParameterDescriptions
Blueprint::getDescriptions() const
@@ -71,6 +69,4 @@ Blueprint::setup(const IIndexEnvironment &indexEnv,
return false;
}
-
-} // namespace fef
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/fef/blueprintresolver.cpp b/searchlib/src/vespa/searchlib/fef/blueprintresolver.cpp
index a8d2e4d7f6b..a9e500fc802 100644
--- a/searchlib/src/vespa/searchlib/fef/blueprintresolver.cpp
+++ b/searchlib/src/vespa/searchlib/fef/blueprintresolver.cpp
@@ -3,14 +3,14 @@
#include "blueprintresolver.h"
#include "blueprintfactory.h"
#include "featurenameparser.h"
-#include <stack>
#include <vespa/vespalib/util/stringfmt.h>
+#include <stack>
+#include <cassert>
#include <vespa/log/log.h>
LOG_SETUP(".fef.blueprintresolver");
-namespace search {
-namespace fef {
+namespace search::fef {
namespace {
@@ -230,6 +230,4 @@ BlueprintResolver::getSeedMap() const
return _seedMap;
}
-
-} // namespace fef
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/fef/matchdatalayout.cpp b/searchlib/src/vespa/searchlib/fef/matchdatalayout.cpp
index 169dfd45863..bcecbf6d773 100644
--- a/searchlib/src/vespa/searchlib/fef/matchdatalayout.cpp
+++ b/searchlib/src/vespa/searchlib/fef/matchdatalayout.cpp
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "matchdatalayout.h"
+#include <cassert>
namespace search::fef {
@@ -10,15 +11,14 @@ MatchDataLayout::MatchDataLayout()
{
}
-MatchDataLayout::~MatchDataLayout() { }
+MatchDataLayout::~MatchDataLayout() = default;
MatchData::UP
MatchDataLayout::createMatchData() const
{
- MatchData::UP md(new MatchData(MatchData::params()
- .numTermFields(_numTermFields)));
assert(_numTermFields == _fieldIds.size());
+ auto md = std::make_unique<MatchData>(MatchData::params().numTermFields(_numTermFields));
for (size_t i = 0; i < _numTermFields; ++i) {
md->resolveTermField(i)->setFieldId(_fieldIds[i]);
}
diff --git a/searchlib/src/vespa/searchlib/fef/rank_program.cpp b/searchlib/src/vespa/searchlib/fef/rank_program.cpp
index 33a65b48a1c..80729d90bf5 100644
--- a/searchlib/src/vespa/searchlib/fef/rank_program.cpp
+++ b/searchlib/src/vespa/searchlib/fef/rank_program.cpp
@@ -4,6 +4,7 @@
#include "featureoverrider.h"
#include <vespa/vespalib/locale/c.h>
#include <algorithm>
+#include <cassert>
using vespalib::Stash;
diff --git a/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.cpp b/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.cpp
index c5c7d2dc574..69baa772639 100644
--- a/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.cpp
+++ b/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.cpp
@@ -2,6 +2,7 @@
#include "termfieldmatchdata.h"
#include <limits>
+#include <cassert>
namespace search::fef {
@@ -28,7 +29,8 @@ TermFieldMatchData::TermFieldMatchData(const TermFieldMatchData & rhs) :
}
}
-TermFieldMatchData & TermFieldMatchData::operator = (const TermFieldMatchData & rhs)
+TermFieldMatchData &
+TermFieldMatchData::operator = (const TermFieldMatchData & rhs)
{
if (this != & rhs) {
TermFieldMatchData tmp(rhs);
@@ -47,6 +49,27 @@ TermFieldMatchData::~TermFieldMatchData()
}
}
+TermFieldMatchData::MutablePositionsIterator
+TermFieldMatchData::populate_fixed() {
+ assert(!allocated());
+ if (_sz == 0) {
+ new (_data._position) TermFieldMatchDataPosition();
+ _sz = 1;
+ }
+ return getFixed();
+}
+
+TermFieldMatchData &
+TermFieldMatchData::setFieldId(uint32_t fieldId) {
+ if (fieldId == IllegalFieldId) {
+ fieldId = FIELDID_MASK;
+ } else {
+ assert(fieldId < FIELDID_MASK);
+ }
+ _fieldId = (_fieldId & ~FIELDID_MASK) | fieldId;
+ return *this;
+}
+
namespace {
template <typename T>
diff --git a/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h b/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h
index a0a37d9d66c..01851a7c2fb 100644
--- a/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h
+++ b/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h
@@ -6,7 +6,6 @@
#include "fieldinfo.h"
#include <vespa/searchlib/common/feature.h>
#include <cstring>
-#include <cassert>
class MatchDataHeapTest;
@@ -92,14 +91,7 @@ public:
**/
void swap(TermFieldMatchData &rhs);
- MutablePositionsIterator populate_fixed() {
- assert(!allocated());
- if (_sz == 0) {
- new (_data._position) TermFieldMatchDataPosition();
- _sz = 1;
- }
- return getFixed();
- }
+ MutablePositionsIterator populate_fixed();
/**
* Set which field this object has match information for.
@@ -107,15 +99,7 @@ public:
* @return this object (for chaining)
* @param fieldId field id
**/
- TermFieldMatchData &setFieldId(uint32_t fieldId) {
- if (fieldId == IllegalFieldId) {
- fieldId = FIELDID_MASK;
- } else {
- assert(fieldId < FIELDID_MASK);
- }
- _fieldId = (_fieldId & ~FIELDID_MASK) | fieldId;
- return *this;
- }
+ TermFieldMatchData &setFieldId(uint32_t fieldId);
/**
* Obtain the field id
diff --git a/searchlib/src/vespa/searchlib/fef/test/plugin/double.cpp b/searchlib/src/vespa/searchlib/fef/test/plugin/double.cpp
index 62b7e4dc775..d9ec8b13e57 100644
--- a/searchlib/src/vespa/searchlib/fef/test/plugin/double.cpp
+++ b/searchlib/src/vespa/searchlib/fef/test/plugin/double.cpp
@@ -3,10 +3,9 @@
#include "double.h"
#include <vespa/searchlib/fef/featurenamebuilder.h>
#include <vespa/vespalib/stllike/asciistream.h>
+#include <cassert>
-namespace search {
-namespace fef {
-namespace test {
+namespace search::fef::test {
void
DoubleExecutor::execute(uint32_t)
@@ -57,6 +56,4 @@ DoubleBlueprint::createExecutor(const IQueryEnvironment &queryEnv, vespalib::Sta
return stash.create<DoubleExecutor>(_cnt);
}
-} // namespace test
-} // namespace fef
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/fef/utils.cpp b/searchlib/src/vespa/searchlib/fef/utils.cpp
index eb628e5f8a0..456060118d7 100644
--- a/searchlib/src/vespa/searchlib/fef/utils.cpp
+++ b/searchlib/src/vespa/searchlib/fef/utils.cpp
@@ -2,9 +2,9 @@
#include "utils.h"
#include <vector>
+#include <cassert>
-namespace search {
-namespace fef {
+namespace search::fef {
feature_t
Utils::getScoreFeature(const RankProgram &rankProgram, uint32_t docid)
@@ -55,5 +55,4 @@ Utils::getAllFeatures(const RankProgram &rankProgram, uint32_t docid)
return resolveFeatures(resolver, docid);
}
-} // namespace fef
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp b/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp
index 6e64264facb..8c864c91ef8 100644
--- a/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp
@@ -1,9 +1,9 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "field_spec.h"
+#include <cassert>
-namespace search {
-namespace queryeval {
+namespace search::queryeval {
FieldSpecBase::FieldSpecBase(uint32_t fieldId, fef::TermFieldHandle handle, bool isFilter_) :
_fieldId(fieldId | (isFilter_ ? 0x1000000u : 0)),
@@ -12,5 +12,4 @@ FieldSpecBase::FieldSpecBase(uint32_t fieldId, fef::TermFieldHandle handle, bool
assert(fieldId < 0x1000000); // Can be represented by 24 bits
}
-} // namespace queryeval
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/queryeval/searchiterator.cpp b/searchlib/src/vespa/searchlib/queryeval/searchiterator.cpp
index c4a308a17f6..9450aceb2be 100644
--- a/searchlib/src/vespa/searchlib/queryeval/searchiterator.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/searchiterator.cpp
@@ -11,18 +11,6 @@
namespace search::queryeval {
-SearchIterator::SearchIterator() :
- _docid(0),
- _endid(0)
-{ }
-
-void
-SearchIterator::initRange(uint32_t beginid, uint32_t endid)
-{
- _docid = beginid - 1;
- _endid = endid;
-}
-
BitVector::UP
SearchIterator::get_hits(uint32_t begin_id)
{
diff --git a/searchlib/src/vespa/searchlib/queryeval/searchiterator.h b/searchlib/src/vespa/searchlib/queryeval/searchiterator.h
index d2a5ed1e5f9..27494e08f90 100644
--- a/searchlib/src/vespa/searchlib/queryeval/searchiterator.h
+++ b/searchlib/src/vespa/searchlib/queryeval/searchiterator.h
@@ -4,6 +4,7 @@
#include "posting_info.h"
#include "begin_and_end_id.h"
+#include <vespa/searchlib/fef/termfieldmatchdataposition.h>
#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/util/trinary.h>
#include <memory>
@@ -118,7 +119,10 @@ public:
* @param beginId This is the first valid docId and the lowest that will be given to doSeek.
* @param endId This is the first docid after the valid range.
*/
- virtual void initRange(uint32_t begin_id, uint32_t end_id);
+ virtual void initRange(uint32_t begin_id, uint32_t end_id) {
+ _docid = begin_id - 1;
+ _endid = end_id;
+ }
/**
* Will initialize the full range.
@@ -177,7 +181,7 @@ public:
/**
* The constructor sets the current document id to @ref beginId.
**/
- SearchIterator();
+ SearchIterator() : _docid(0), _endid(0) { }
SearchIterator(const SearchIterator &) = delete;
SearchIterator &operator=(const SearchIterator &) = delete;