diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-09-23 07:16:31 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-09-23 07:16:31 +0000 |
commit | aec20e0986d71c1a8cd4a7a7153bf81b304a233f (patch) | |
tree | af01498e5b3eeb4645112bdfabe29d0062076f46 /searchlib | |
parent | dd30a9a839f4b7f5c99e265af091c3f88613f4cd (diff) |
Reduce include and visibility of ptrholder.h
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchcommon/common/schema.cpp | 13 | ||||
-rw-r--r-- | searchlib/src/vespa/searchcommon/common/schema.h | 13 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/docstore/filechunk.h | 1 |
3 files changed, 13 insertions, 14 deletions
diff --git a/searchlib/src/vespa/searchcommon/common/schema.cpp b/searchlib/src/vespa/searchcommon/common/schema.cpp index 0cc9d3cb2d8..1f2f924a4cd 100644 --- a/searchlib/src/vespa/searchcommon/common/schema.cpp +++ b/searchlib/src/vespa/searchcommon/common/schema.cpp @@ -6,6 +6,7 @@ #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/stllike/hashtable.hpp> #include <vespa/fastos/file.h> +#include <limits> #include <vespa/log/log.h> LOG_SETUP(".index.schema"); @@ -48,7 +49,7 @@ writeFieldSets(vespalib::asciistream &os, struct FieldName { vespalib::string name; - FieldName(const config::StringVector & lines) + explicit FieldName(const config::StringVector & lines) : name(ConfigParser::parse<vespalib::string>("name", lines)) { } @@ -184,9 +185,9 @@ Schema::FieldSet::FieldSet(const config::StringVector & lines) : _name(ConfigParser::parse<vespalib::string>("name", lines)), _fields() { - std::vector<FieldName> fn = ConfigParser::parseArray<std::vector<FieldName>>("field", lines); - for (size_t i = 0; i < fn.size(); ++i) { - _fields.push_back(fn[i].name); + auto fn = ConfigParser::parseArray<std::vector<FieldName>>("field", lines); + for (const auto & fname : fn) { + _fields.push_back(fname.name); } } @@ -224,8 +225,8 @@ Schema::Schema() = default; Schema::Schema(const Schema & rhs) = default; Schema & Schema::operator=(const Schema & rhs) = default; -Schema::Schema(Schema && rhs) = default; -Schema & Schema::operator=(Schema && rhs) = default; +Schema::Schema(Schema && rhs) noexcept = default; +Schema & Schema::operator=(Schema && rhs) noexcept = default; Schema::~Schema() = default; bool diff --git a/searchlib/src/vespa/searchcommon/common/schema.h b/searchlib/src/vespa/searchcommon/common/schema.h index 42291e04634..2e9edaa702e 100644 --- a/searchlib/src/vespa/searchcommon/common/schema.h +++ b/searchlib/src/vespa/searchcommon/common/schema.h @@ -5,7 +5,6 @@ #include "datatype.h" #include <vespa/config/common/types.h> #include <vespa/vespalib/stllike/hash_map.h> -#include <vespa/vespalib/util/ptrholder.h> namespace vespalib { class asciistream; } namespace search::index { @@ -90,7 +89,7 @@ public: /** * Create this index field based on the given config lines. **/ - IndexField(const config::StringVector &lines); + explicit IndexField(const config::StringVector &lines); IndexField &setAvgElemLen(uint32_t avgElemLen) { _avgElemLen = avgElemLen; return *this; } IndexField &set_interleaved_features(bool value) { @@ -121,7 +120,7 @@ public: std::vector<vespalib::string> _fields; public: - FieldSet(vespalib::stringref n) : _name(n), _fields() {} + explicit FieldSet(vespalib::stringref n) : _name(n), _fields() {} FieldSet(const FieldSet &); FieldSet & operator =(const FieldSet &); FieldSet(FieldSet &&) noexcept = default; @@ -130,12 +129,12 @@ public: /** * Create this field collection based on the given config lines. **/ - FieldSet(const config::StringVector & lines); + explicit FieldSet(const config::StringVector & lines); ~FieldSet(); FieldSet &addField(vespalib::stringref fieldName) { - _fields.push_back(fieldName); + _fields.emplace_back(fieldName); return *this; } @@ -170,8 +169,8 @@ public: Schema(); Schema(const Schema & rhs); Schema & operator=(const Schema & rhs); - Schema(Schema && rhs); - Schema & operator=(Schema && rhs); + Schema(Schema && rhs) noexcept; + Schema & operator=(Schema && rhs) noexcept; ~Schema(); /** diff --git a/searchlib/src/vespa/searchlib/docstore/filechunk.h b/searchlib/src/vespa/searchlib/docstore/filechunk.h index 2a2cbb45c53..af5690e8569 100644 --- a/searchlib/src/vespa/searchlib/docstore/filechunk.h +++ b/searchlib/src/vespa/searchlib/docstore/filechunk.h @@ -12,7 +12,6 @@ #include <vespa/vespalib/util/cpu_usage.h> #include <vespa/vespalib/util/generationhandler.h> #include <vespa/vespalib/util/memoryusage.h> -#include <vespa/vespalib/util/ptrholder.h> #include <vespa/vespalib/util/time.h> class FastOS_FileInterface; |