diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-03-14 16:08:22 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-03-14 16:24:03 +0000 |
commit | 992e6a6bbe7fb7ae5d122c65c07843655a78cb57 (patch) | |
tree | 388716daa313ac58eec25b613a8cffef78eae268 /searchlib | |
parent | d7ade13fee737d8b214bb87c164684fdfcb6970f (diff) |
Prefer std::vector
Diffstat (limited to 'searchlib')
4 files changed, 19 insertions, 25 deletions
diff --git a/searchlib/src/vespa/searchlib/aggregation/fs4hit.h b/searchlib/src/vespa/searchlib/aggregation/fs4hit.h index 9a3bceb22d4..af09d3ff26b 100644 --- a/searchlib/src/vespa/searchlib/aggregation/fs4hit.h +++ b/searchlib/src/vespa/searchlib/aggregation/fs4hit.h @@ -19,16 +19,15 @@ public: DECLARE_IDENTIFIABLE_NS2(search, aggregation, FS4Hit); DECLARE_NBO_SERIALIZE; FS4Hit() noexcept : Hit(), _path(0), _docId(0), _globalId(), _distributionKey(-1) {} - FS4Hit(DocId docId, HitRank rank) + FS4Hit(DocId docId, HitRank rank) noexcept : Hit(rank), _path(0), _docId(docId), _globalId(), _distributionKey(-1) {} FS4Hit *clone() const override { return new FS4Hit(*this); } void visitMembers(vespalib::ObjectVisitor &visitor) const override; - uint32_t getPath() const { return _path; } - FS4Hit &setPath(uint32_t val) { _path = val; return *this; } - uint32_t getDocId() const { return _docId; } - const document::GlobalId & getGlobalId() const { return _globalId; } - FS4Hit &setGlobalId(const document::GlobalId & globalId) { _globalId = globalId; return *this; } - FS4Hit &setDistributionKey(uint32_t val) { _distributionKey = val; return *this; } + uint32_t getPath() const noexcept { return _path; } + uint32_t getDocId() const noexcept { return _docId; } + const document::GlobalId & getGlobalId() const noexcept { return _globalId; } + FS4Hit &setGlobalId(const document::GlobalId & globalId) noexcept { _globalId = globalId; return *this; } + FS4Hit &setDistributionKey(uint32_t val) noexcept { _distributionKey = val; return *this; } bool operator < (const FS4Hit &b) const { return cmp(b) < 0; } }; diff --git a/searchlib/src/vespa/searchlib/aggregation/vdshit.h b/searchlib/src/vespa/searchlib/aggregation/vdshit.h index c2f55f8a0bb..8908eda6574 100644 --- a/searchlib/src/vespa/searchlib/aggregation/vdshit.h +++ b/searchlib/src/vespa/searchlib/aggregation/vdshit.h @@ -3,32 +3,31 @@ #include "hit.h" #include "aggregationresult.h" -#include <vespa/vespalib/util/array.h> namespace search::aggregation { class VdsHit : public Hit { public: - using Summary = vespalib::Array<uint8_t>; + using Summary = std::vector<uint8_t>; using DocId = vespalib::string; DECLARE_IDENTIFIABLE_NS2(search, aggregation, VdsHit); DECLARE_NBO_SERIALIZE; - VdsHit() : Hit(), _docId(), _summary() {} - VdsHit(DocId docId, HitRank rank) : Hit(rank), _docId(docId), _summary() {} + VdsHit() noexcept : Hit(), _docId(), _summary() {} + VdsHit(DocId docId, HitRank rank) noexcept : Hit(rank), _docId(docId), _summary() {} ~VdsHit(); VdsHit *clone() const override { return new VdsHit(*this); } void visitMembers(vespalib::ObjectVisitor &visitor) const override; - const DocId & getDocId() const { return _docId; } - const Summary & getSummary() const { return _summary; } - VdsHit & setDocId(DocId & docId) { _docId = docId; return *this; } - VdsHit & setSummary(const void * buf, size_t sz) { + const DocId & getDocId() const noexcept { return _docId; } + const Summary & getSummary() const noexcept { return _summary; } + VdsHit & setDocId(DocId & docId) noexcept { _docId = docId; return *this; } + VdsHit & setSummary(const void * buf, size_t sz) noexcept { const uint8_t * v(static_cast<const uint8_t *>(buf)); Summary n(v, v+sz); _summary.swap(n); return *this; } - bool operator < (const VdsHit &b) const { return cmp(b) < 0; } + bool operator < (const VdsHit &b) const noexcept { return cmp(b) < 0; } private: DocId _docId; diff --git a/searchlib/src/vespa/searchlib/grouping/collect.cpp b/searchlib/src/vespa/searchlib/grouping/collect.cpp index 11e297fef2a..9085b08d0f2 100644 --- a/searchlib/src/vespa/searchlib/grouping/collect.cpp +++ b/searchlib/src/vespa/searchlib/grouping/collect.cpp @@ -4,12 +4,10 @@ #include <vespa/vespalib/util/array.hpp> #include <cassert> -namespace search { +using namespace search::expression; +using namespace search::aggregation; -using namespace expression; -using namespace aggregation; - -namespace grouping { +namespace search::grouping { Collect::ResultAccessor::ResultAccessor(const AggregationResult & aggregator, size_t offset) : _bluePrint(&aggregator), @@ -109,7 +107,6 @@ Collect::preFill(GroupRef gr, const Group & g) } } -} // this function was added by ../../forcelink.sh void forcelink_file_searchlib_grouping_collect() {} diff --git a/searchlib/src/vespa/searchlib/grouping/collect.h b/searchlib/src/vespa/searchlib/grouping/collect.h index 5c27fd7e431..34906e90324 100644 --- a/searchlib/src/vespa/searchlib/grouping/collect.h +++ b/searchlib/src/vespa/searchlib/grouping/collect.h @@ -3,9 +3,9 @@ #include "groupref.h" #include <vespa/searchlib/aggregation/group.h> +#include <vespa/vespalib/util/array.h> -namespace search { -namespace grouping { +namespace search::grouping { class Collect { @@ -105,4 +105,3 @@ private: }; } -} |