summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-02-04 17:33:08 +0100
committerHenning Baldersheim <balder@oath.com>2018-02-04 17:33:08 +0100
commit1c81f74a24af0d00911002d4237843c0e735fa8d (patch)
treed7e758ea7b3f6a7df0a6833729f6a6d329da7d49
parentbf468f0a4367fb5ab9117274bcceb8ba9de59109 (diff)
NULL -> nullptr
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/hitcollector.h4
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/queryenvironment.h4
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/querywrapper.cpp2
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/querywrapper.h8
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/rankprocessor.cpp2
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/searchenvironment.cpp2
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp32
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/searchvisitor.h4
8 files changed, 29 insertions, 29 deletions
diff --git a/streamingvisitors/src/vespa/searchvisitor/hitcollector.h b/streamingvisitors/src/vespa/searchvisitor/hitcollector.h
index ebc2f15e23c..2f71c5d7a71 100644
--- a/streamingvisitors/src/vespa/searchvisitor/hitcollector.h
+++ b/streamingvisitors/src/vespa/searchvisitor/hitcollector.h
@@ -92,7 +92,7 @@ public:
/**
* Adds a hit to this hit collector.
* Make sure that the hits are added in increasing local docId order.
- * If you add a NULL document you should not use getDocSum() or fillSearchResult(),
+ * If you add a nullptr document you should not use getDocSum() or fillSearchResult(),
* as these functions expect valid documents.
*
* @param doc The document that is a hit. Must be kept alive on the outside.
@@ -104,7 +104,7 @@ public:
/**
* Adds a hit to this hit collector.
* Make sure that the hits are added in increasing local docId order.
- * If you add a NULL document you should not use getDocSum() or fillSearchResult(),
+ * If you add a nullptr document you should not use getDocSum() or fillSearchResult(),
* as these functions expect valid documents.
*
* @param doc The document that is a hit. Must be kept alive on the outside.
diff --git a/streamingvisitors/src/vespa/searchvisitor/queryenvironment.h b/streamingvisitors/src/vespa/searchvisitor/queryenvironment.h
index 33b746178d5..b9391ac838c 100644
--- a/streamingvisitors/src/vespa/searchvisitor/queryenvironment.h
+++ b/streamingvisitors/src/vespa/searchvisitor/queryenvironment.h
@@ -31,7 +31,7 @@ public:
QueryEnvironment(const vespalib::string & location,
const IndexEnvironment & indexEnv,
const search::fef::Properties & properties,
- const search::IAttributeManager * attrMgr = NULL);
+ const search::IAttributeManager * attrMgr = nullptr);
~QueryEnvironment();
// inherit documentation
@@ -43,7 +43,7 @@ public:
// inherit documentation
virtual const search::fef::ITermData *getTerm(uint32_t idx) const override {
if (idx >= _queryTerms.size()) {
- return NULL;
+ return nullptr;
}
return _queryTerms[idx];
}
diff --git a/streamingvisitors/src/vespa/searchvisitor/querywrapper.cpp b/streamingvisitors/src/vespa/searchvisitor/querywrapper.cpp
index 01f29ef8121..a4541eb0440 100644
--- a/streamingvisitors/src/vespa/searchvisitor/querywrapper.cpp
+++ b/streamingvisitors/src/vespa/searchvisitor/querywrapper.cpp
@@ -27,7 +27,7 @@ QueryWrapper::PhraseList::findPhrase(QueryTerm * term, size_t & index)
}
}
}
- return NULL;
+ return nullptr;
}
QueryWrapper::QueryWrapper(Query & query) :
diff --git a/streamingvisitors/src/vespa/searchvisitor/querywrapper.h b/streamingvisitors/src/vespa/searchvisitor/querywrapper.h
index eb8d15f8408..94ba63ef569 100644
--- a/streamingvisitors/src/vespa/searchvisitor/querywrapper.h
+++ b/streamingvisitors/src/vespa/searchvisitor/querywrapper.h
@@ -30,8 +30,8 @@ public:
public:
Term() :
- _term(NULL),
- _parent(NULL),
+ _term(nullptr),
+ _parent(nullptr),
_index(0)
{
}
@@ -44,9 +44,9 @@ public:
search::QueryTerm * getTerm() { return _term; }
search::PhraseQueryNode * getParent() { return _parent; }
size_t getIndex() const { return _index; }
- bool isPhraseTerm() const { return _parent != NULL; }
+ bool isPhraseTerm() const { return _parent != nullptr; }
bool isFirstPhraseTerm() const { return isPhraseTerm() && getIndex() == 0; }
- size_t getPosAdjust() const { return _parent != NULL ? _parent->width() - 1 : 0; }
+ size_t getPosAdjust() const { return _parent != nullptr ? _parent->width() - 1 : 0; }
};
typedef std::vector<Term> TermList;
diff --git a/streamingvisitors/src/vespa/searchvisitor/rankprocessor.cpp b/streamingvisitors/src/vespa/searchvisitor/rankprocessor.cpp
index dc9cfdc7efd..dd52c020042 100644
--- a/streamingvisitors/src/vespa/searchvisitor/rankprocessor.cpp
+++ b/streamingvisitors/src/vespa/searchvisitor/rankprocessor.cpp
@@ -68,7 +68,7 @@ RankProcessor::initQueryEnvironment()
vespalib::string expandedIndexName = vsm::FieldSearchSpecMap::stripNonFields(terms[i].getTerm()->index());
const RankManager::View *view = _rankManagerSnapshot->getView(expandedIndexName);
- if (view != NULL) {
+ if (view != nullptr) {
RankManager::View::const_iterator iter = view->begin();
RankManager::View::const_iterator endp = view->end();
for (; iter != endp; ++iter) {
diff --git a/streamingvisitors/src/vespa/searchvisitor/searchenvironment.cpp b/streamingvisitors/src/vespa/searchvisitor/searchenvironment.cpp
index 7ebb71f1855..7de96f0c4ab 100644
--- a/streamingvisitors/src/vespa/searchvisitor/searchenvironment.cpp
+++ b/streamingvisitors/src/vespa/searchvisitor/searchenvironment.cpp
@@ -65,7 +65,7 @@ SearchEnvironment::Env &
SearchEnvironment::getEnv(const vespalib::string & searchCluster)
{
config::ConfigUri searchClusterUri(_configUri.createWithNewId(searchCluster));
- if (_localEnvMap == NULL) {
+ if (_localEnvMap == nullptr) {
EnvMapUP envMap = std::make_unique<EnvMap>();
_localEnvMap = envMap.get();
vespalib::LockGuard guard(_lock);
diff --git a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp
index e3483e8beac..f42dfe5af98 100644
--- a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp
+++ b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp
@@ -105,7 +105,7 @@ SearchVisitor::SummaryGenerator::SummaryGenerator() :
_callback(),
_docsumState(_callback),
_docsumFilter(),
- _docsumWriter(NULL),
+ _docsumWriter(nullptr),
_rawBuf(4096)
{
}
@@ -116,7 +116,7 @@ SearchVisitor::SummaryGenerator::~SummaryGenerator() { }
vespalib::ConstBufferRef
SearchVisitor::SummaryGenerator::fillSummary(AttributeVector::DocId lid, const HitsAggregationResult::SummaryClassType & summaryClass)
{
- if (_docsumWriter != NULL) {
+ if (_docsumWriter != nullptr) {
_rawBuf.reset();
_docsumState._args.setResultClassName(summaryClass);
uint32_t docsumLen = _docsumWriter->WriteDocsum(lid, &_docsumState, _docsumFilter.get(), &_rawBuf);
@@ -168,7 +168,7 @@ SearchVisitor::SearchVisitor(StorageComponent& component,
Visitor(component),
_env(static_cast<SearchEnvironment &>(vEnv)),
_params(params),
- _vsmAdapter(NULL),
+ _vsmAdapter(nullptr),
_docSearchedCount(0),
_hitCount(0),
_hitsRejectedCount(0),
@@ -185,7 +185,7 @@ SearchVisitor::SearchVisitor(StorageComponent& component,
_groupingList(),
_attributeFields(),
_sortList(),
- _docsumWriter(NULL),
+ _docsumWriter(nullptr),
_searchBuffer(new vsm::SearcherBuf()),
_tmpSortBuffer(256),
_documentIdAttributeBacking(new search::SingleStringExtAttribute("[docid]") ),
@@ -213,7 +213,7 @@ void SearchVisitor::init(const Parameters & params)
size_t wantedSummaryCount(10);
if (params.get("summarycount", valueRef) ) {
vespalib::string tmp(valueRef.data(), valueRef.size());
- wantedSummaryCount = strtoul(tmp.c_str(), NULL, 0);
+ wantedSummaryCount = strtoul(tmp.c_str(), nullptr, 0);
LOG(debug, "Received summary count: %ld", wantedSummaryCount);
}
_queryResult->getSearchResult().setWantedHitCount(wantedSummaryCount);
@@ -226,8 +226,8 @@ void SearchVisitor::init(const Parameters & params)
if (params.get("queryflags", valueRef) ) {
vespalib::string tmp(valueRef.data(), valueRef.size());
- LOG(debug, "Received query flags: 0x%lx", strtoul(tmp.c_str(), NULL, 0));
- uint32_t queryFlags = strtoul(tmp.c_str(), NULL, 0);
+ LOG(debug, "Received query flags: 0x%lx", strtoul(tmp.c_str(), nullptr, 0));
+ uint32_t queryFlags = strtoul(tmp.c_str(), nullptr, 0);
_rankController.setDumpFeatures((queryFlags & search::fs4transport::QFLAG_DUMP_FEATURES) != 0);
LOG(debug, "QFLAG_DUMP_FEATURES: %s", _rankController.getDumpFeatures() ? "true" : "false");
}
@@ -432,7 +432,7 @@ SearchVisitor::RankController::processHintedAttributes(const IndexEnvironment &
for (const vespalib::string & name : attributes) {
LOG(debug, "Process attribute access hint (%s): '%s'", rank ? "rank" : "dump", name.c_str());
const search::fef::FieldInfo * fieldInfo = indexEnv.getFieldByName(name);
- if (fieldInfo != NULL) {
+ if (fieldInfo != nullptr) {
bool found = false;
uint32_t fid = fieldInfo->id();
for (size_t j = 0; !found && (j < attributeFields.size()); ++j) {
@@ -457,8 +457,8 @@ SearchVisitor::RankController::processHintedAttributes(const IndexEnvironment &
SearchVisitor::RankController::RankController() :
_rankProfile("default"),
- _rankManagerSnapshot(NULL),
- _rankSetup(NULL),
+ _rankManagerSnapshot(nullptr),
+ _rankSetup(nullptr),
_queryProperties(),
_hasRanking(false),
_rankProcessor(),
@@ -694,7 +694,7 @@ SearchVisitor::setupDocsumObjects()
_vsmAdapter->getDocsumTools()->getDocsumWriter()->InitState(_attrMan, ds);
_summaryGenerator.setDocsumWriter(*_vsmAdapter->getDocsumTools()->getDocsumWriter());
for (const IAttributeVector * v : ds->_attributes) {
- if (v != NULL) {
+ if (v != nullptr) {
vespalib::string name(v->getName());
vsm::FieldIdT fid = _fieldSearchSpecMap.nameIdMap().fieldNo(name);
if ( fid != StringFieldIdTMap::npos ) {
@@ -872,7 +872,7 @@ SearchVisitor::handleDocuments(const document::BucketId&,
HitCounter& hitCounter)
{
(void) hitCounter;
- if (_vsmAdapter == NULL) {
+ if (_vsmAdapter == nullptr) {
init(_params);
}
if ( ! _rankController.valid() ) {
@@ -889,7 +889,7 @@ SearchVisitor::handleDocuments(const document::BucketId&,
StorageDocument::UP document(new StorageDocument(entry->releaseDocument(), _fieldPathMap, highestFieldNo));
try {
- if (defaultDocType != NULL
+ if (defaultDocType != nullptr
&& !compatibleDocumentTypes(*defaultDocType, document->docDoc().getType()))
{
LOG(debug, "Skipping document of type '%s' when handling only documents of type '%s'",
@@ -1001,7 +1001,7 @@ SearchVisitor::fillAttributeVectors(const vespalib::string & documentId, const S
AttributeVector & attrV = const_cast<AttributeVector & >(*finfoGuard);
AttributeVector::DocId docId(0);
attrV.addDoc(docId);
- if (subDoc.getFieldValue() != NULL) {
+ if (subDoc.getFieldValue() != nullptr) {
LOG(debug, "value = '%s'", subDoc.getFieldValue()->toString().c_str());
if (isPosition) {
LOG(spam, "Position");
@@ -1053,7 +1053,7 @@ void SearchVisitor::completedBucket(const document::BucketId&, HitCounter&)
void SearchVisitor::completedVisitingInternal(HitCounter& hitCounter)
{
- if (_vsmAdapter == NULL) {
+ if (_vsmAdapter == nullptr) {
init(_params);
}
LOG(debug, "Completed visiting");
@@ -1120,7 +1120,7 @@ SearchVisitor::generateDocumentSummaries()
vdslib::SearchResult & searchResult(_queryResult->getSearchResult());
vdslib::DocumentSummary & documentSummary(_queryResult->getDocumentSummary());
for (size_t i(0), m(searchResult.getHitCount()); (i < m) && (i < searchResult.getWantedHitCount()); i++ ) {
- const char * docId(NULL);
+ const char * docId(nullptr);
vdslib::SearchResult::RankType rank(0);
uint32_t lid = searchResult.getHit(i, docId, rank);
vespalib::ConstBufferRef docsum = _summaryGenerator.fillSummary(lid, _summaryClass);
diff --git a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.h b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.h
index 5f497732802..ceadd8a9c79 100644
--- a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.h
+++ b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.h
@@ -60,7 +60,7 @@ private:
AttrInfo(vsm::FieldIdT fid, search::AttributeGuard::UP attr) :
_field(fid),
_ascending(true),
- _converter(NULL),
+ _converter(nullptr),
_attr(std::move(attr))
{ }
/**
@@ -135,7 +135,7 @@ private:
public:
RankController();
~RankController();
- bool valid() const { return _rankProcessor.get() != NULL; }
+ bool valid() const { return _rankProcessor.get() != nullptr; }
void setRankProfile(const vespalib::string &rankProfile) { _rankProfile = rankProfile; }
const vespalib::string &getRankProfile() const { return _rankProfile; }
void setRankManagerSnapshot(const RankManager::Snapshot::SP & snapshot) { _rankManagerSnapshot = snapshot; }