summaryrefslogtreecommitdiffstats
path: root/searchcore/src
diff options
context:
space:
mode:
Diffstat (limited to 'searchcore/src')
-rw-r--r--searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp2
-rw-r--r--searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp4
-rw-r--r--searchcore/src/tests/proton/matching/match_loop_communicator/match_loop_communicator_test.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/matcher.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/partial_result.cpp12
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp10
6 files changed, 19 insertions, 17 deletions
diff --git a/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp b/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp
index 2d7e242b9fb..e367df3abbd 100644
--- a/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp
+++ b/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp
@@ -159,7 +159,7 @@ check(const AttributePtr &vec, uint32_t docId, const std::vector<T> &values)
uint32_t sz = vec->getValueCount(docId);
if (!EXPECT_EQUAL(sz, values.size())) return false;
std::vector<T> buf(sz);
- uint32_t asz = vec->get(docId, &buf[0], sz);
+ uint32_t asz = vec->get(docId, buf.data(), sz);
if (!EXPECT_EQUAL(sz, asz)) return false;
std::vector<T> wanted(values.begin(), values.end());
if (vec->hasWeightedSetType()) {
diff --git a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
index 5c4d7aca41d..6c1821dc00e 100644
--- a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
+++ b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
@@ -232,9 +232,9 @@ TEST("require that serialize/deserialize works for CompactLidSpaceOperation")
op.serialize(stream);
}
{
- const document::DocumentTypeRepo *repo = NULL;
+ const document::DocumentTypeRepo repo;
CompactLidSpaceOperation op;
- op.deserialize(stream, *repo);
+ op.deserialize(stream, repo);
EXPECT_EQUAL(FeedOperation::COMPACT_LID_SPACE, op.getType());
EXPECT_EQUAL(2u, op.getSubDbId());
EXPECT_EQUAL(99u, op.getLidLimit());
diff --git a/searchcore/src/tests/proton/matching/match_loop_communicator/match_loop_communicator_test.cpp b/searchcore/src/tests/proton/matching/match_loop_communicator/match_loop_communicator_test.cpp
index 4c2afe32ae8..0cf7aea6c00 100644
--- a/searchcore/src/tests/proton/matching/match_loop_communicator/match_loop_communicator_test.cpp
+++ b/searchcore/src/tests/proton/matching/match_loop_communicator/match_loop_communicator_test.cpp
@@ -32,7 +32,7 @@ std::tuple<size_t,Hits,RangePair> second_phase(MatchLoopCommunicator &com, const
for (size_t i = 0; i < hits.size(); ++i) {
refs.push_back(i);
}
- auto my_work = com.get_second_phase_work(SortedHitSequence(&hits[0], &refs[0], refs.size()), thread_id);
+ auto my_work = com.get_second_phase_work(SortedHitSequence(hits.data(), refs.data(), refs.size()), thread_id);
// the DocumentScorer used by the match thread will sort on docid here to ensure increasing seek order, this is not needed here
size_t work_size = my_work.size();
for (auto &[hit, tag]: my_work) {
diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
index 88d5281535a..826860b743e 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
@@ -196,8 +196,8 @@ Matcher::match(const SearchRequest &request, vespalib::ThreadBundle &threadBundl
{ // we want to measure full set-up and tear-down time as part of
// collateral time
GroupingContext groupingContext(_clock, request.getTimeOfDoom(),
- &request.groupSpec[0], request.groupSpec.size());
- SessionId sessionId(&request.sessionId[0], request.sessionId.size());
+ request.groupSpec.data(), request.groupSpec.size());
+ SessionId sessionId(request.sessionId.data(), request.sessionId.size());
bool shouldCacheSearchSession = false;
bool shouldCacheGroupingSession = false;
if (!sessionId.empty()) {
@@ -355,7 +355,7 @@ Matcher::create_docsum_matcher(const DocsumRequest &req, ISearchContext &search_
}
}
std::sort(docs.begin(), docs.end());
- SessionId sessionId(&req.sessionId[0], req.sessionId.size());
+ SessionId sessionId(req.sessionId.data(), req.sessionId.size());
bool expectedSessionCached(false);
if (!sessionId.empty()) {
const Properties &cache_props = req.propertiesMap.cacheProperties();
diff --git a/searchcore/src/vespa/searchcore/proton/matching/partial_result.cpp b/searchcore/src/vespa/searchcore/proton/matching/partial_result.cpp
index 432752d69d0..450779dd97d 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/partial_result.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/partial_result.cpp
@@ -20,9 +20,9 @@ void mergeHits(size_t maxHits,
std::vector<search::RankedHit> my_hits;
std::swap(hits, my_hits);
hits.reserve(maxHits);
- const search::RankedHit *a_pos = &my_hits[0];
+ const search::RankedHit *a_pos = my_hits.data();
const search::RankedHit *a_end = a_pos + my_hits.size();
- const search::RankedHit *b_pos = &rhs_hits[0];
+ const search::RankedHit *b_pos = rhs_hits.data();
const search::RankedHit *b_end = b_pos + rhs_hits.size();
while (a_pos < a_end && b_pos < b_end && hits.size() < maxHits) {
if (before(*a_pos, *b_pos)) {
@@ -64,12 +64,12 @@ size_t mergeHits(size_t maxHits,
std::swap(sortData, my_sortData);
hits.reserve(maxHits);
sortData.reserve(maxHits);
- const search::RankedHit *a_pos = &my_hits[0];
+ const search::RankedHit *a_pos = my_hits.data();
const search::RankedHit *a_end = a_pos + my_hits.size();
- const search::RankedHit *b_pos = &rhs_hits[0];
+ const search::RankedHit *b_pos = rhs_hits.data();
const search::RankedHit *b_end = b_pos + rhs_hits.size();
- const PartialResult::SortRef *a_sort_pos = &my_sortData[0];
- const PartialResult::SortRef *b_sort_pos = &rhs_sortData[0];
+ const PartialResult::SortRef *a_sort_pos = my_sortData.data();
+ const PartialResult::SortRef *b_sort_pos = rhs_sortData.data();
while (a_pos < a_end && b_pos < b_end && hits.size() < maxHits) {
if (before(*a_sort_pos, a_pos->_docId,
*b_sort_pos, b_pos->_docId))
diff --git a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp
index 4da09df1297..2c758ee712f 100644
--- a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp
@@ -131,7 +131,7 @@ ConfigFile::ConfigFile(const vespalib::string &name, const vespalib::string &ful
return;
int64_t fileSize = file.getSize();
_content.resize(fileSize);
- file.ReadBuf(&_content[0], fileSize);
+ file.ReadBuf(_content.data(), fileSize);
_modTime = file.GetModificationTime();
}
@@ -143,7 +143,7 @@ ConfigFile::serialize(nbostream &stream) const
stream << static_cast<int64_t>(_modTime);;
uint32_t sz = _content.size();
stream << sz;
- stream.write(&_content[0], sz);
+ stream.write(_content.data(), sz);
return stream;
}
@@ -159,7 +159,9 @@ ConfigFile::deserialize(nbostream &stream)
stream >> sz;
_content.resize(sz);
assert(stream.size() >= sz);
- memcpy(&_content[0], stream.peek(), sz);
+ if (sz > 0) {
+ memcpy(_content.data(), stream.peek(), sz);
+ }
stream.adjustReadPos(sz);
return stream;
}
@@ -173,7 +175,7 @@ ConfigFile::save(const vespalib::string &snapDir) const
assert(openRes);
(void) openRes;
- file.WriteBuf(&_content[0], _content.size());
+ file.WriteBuf(_content.data(), _content.size());
bool closeRes = file.Close();
assert(closeRes);
(void) closeRes;