summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-10-07 11:16:08 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-10-07 11:16:35 +0000
commit9bb9d8e14827ecc4dba2d43e2d9e76248c120e1d (patch)
tree9e64c1471c0391410c824f75e2dc1fbfa8585229 /document
parentf2e89d3361cae0e2e74bac89405a175d6ecf5e98 (diff)
Add noexcept as indicated by -Wnoeexcept
Diffstat (limited to 'document')
-rw-r--r--document/src/vespa/document/repo/documenttyperepo.cpp4
-rw-r--r--document/src/vespa/document/repo/documenttyperepo.h4
-rw-r--r--document/src/vespa/document/repo/fixedtyperepo.cpp2
-rw-r--r--document/src/vespa/document/repo/fixedtyperepo.h8
4 files changed, 9 insertions, 9 deletions
diff --git a/document/src/vespa/document/repo/documenttyperepo.cpp b/document/src/vespa/document/repo/documenttyperepo.cpp
index bcd4edb3ab8..677da16190d 100644
--- a/document/src/vespa/document/repo/documenttyperepo.cpp
+++ b/document/src/vespa/document/repo/documenttyperepo.cpp
@@ -547,13 +547,13 @@ DocumentTypeRepo::~DocumentTypeRepo() {
}
const DocumentType *
-DocumentTypeRepo::getDocumentType(int32_t type_id) const {
+DocumentTypeRepo::getDocumentType(int32_t type_id) const noexcept {
const DataTypeRepo *repo = FindPtr(*_doc_types, type_id);
return repo ? repo->doc_type : nullptr;
}
const DocumentType *
-DocumentTypeRepo::getDocumentType(stringref name) const {
+DocumentTypeRepo::getDocumentType(stringref name) const noexcept {
DocumentTypeMap::const_iterator it = _doc_types->find(DocumentType::createId(name));
if (it != _doc_types->end() && it->second->doc_type->getName() == name) {
diff --git a/document/src/vespa/document/repo/documenttyperepo.h b/document/src/vespa/document/repo/documenttyperepo.h
index f0c59918a74..fd17bd5640a 100644
--- a/document/src/vespa/document/repo/documenttyperepo.h
+++ b/document/src/vespa/document/repo/documenttyperepo.h
@@ -34,8 +34,8 @@ public:
explicit DocumentTypeRepo(const DocumenttypesConfig & config);
~DocumentTypeRepo();
- const DocumentType *getDocumentType(int32_t doc_type_id) const;
- const DocumentType *getDocumentType(vespalib::stringref name) const;
+ const DocumentType *getDocumentType(int32_t doc_type_id) const noexcept;
+ const DocumentType *getDocumentType(vespalib::stringref name) const noexcept;
const DataType *getDataType(const DocumentType &doc_type, int32_t id) const;
const DataType *getDataType(const DocumentType &doc_type, vespalib::stringref name) const;
const AnnotationType *getAnnotationType(const DocumentType &doc_type, int32_t id) const;
diff --git a/document/src/vespa/document/repo/fixedtyperepo.cpp b/document/src/vespa/document/repo/fixedtyperepo.cpp
index 81a26265830..20865a8a6ca 100644
--- a/document/src/vespa/document/repo/fixedtyperepo.cpp
+++ b/document/src/vespa/document/repo/fixedtyperepo.cpp
@@ -5,7 +5,7 @@
namespace document {
-FixedTypeRepo::FixedTypeRepo(const DocumentTypeRepo &repo, const vespalib::string &type)
+FixedTypeRepo::FixedTypeRepo(const DocumentTypeRepo &repo, const vespalib::string &type) noexcept
: _repo(&repo), _doc_type(repo.getDocumentType(type))
{
assert(_doc_type);
diff --git a/document/src/vespa/document/repo/fixedtyperepo.h b/document/src/vespa/document/repo/fixedtyperepo.h
index 67e7571e31d..29bef846e36 100644
--- a/document/src/vespa/document/repo/fixedtyperepo.h
+++ b/document/src/vespa/document/repo/fixedtyperepo.h
@@ -13,17 +13,17 @@ class FixedTypeRepo {
const DocumentType *_doc_type;
public:
- explicit FixedTypeRepo(const DocumentTypeRepo &repo)
+ explicit FixedTypeRepo(const DocumentTypeRepo &repo) noexcept
: _repo(&repo), _doc_type(repo.getDefaultDocType()) {}
- FixedTypeRepo(const DocumentTypeRepo &repo, const DocumentType &doc_type)
+ FixedTypeRepo(const DocumentTypeRepo &repo, const DocumentType &doc_type) noexcept
: _repo(&repo), _doc_type(&doc_type) {}
- FixedTypeRepo(const DocumentTypeRepo &repo, const vespalib::string &type);
+ FixedTypeRepo(const DocumentTypeRepo &repo, const vespalib::string &type) noexcept;
const DataType *getDataType(int32_t id) const { return _repo->getDataType(*_doc_type, id); }
const DataType *getDataType(const vespalib::string &name) const { return _repo->getDataType(*_doc_type, name); }
const AnnotationType *getAnnotationType(int32_t id) const { return _repo->getAnnotationType(*_doc_type, id); }
const DocumentTypeRepo &getDocumentTypeRepo() const { return *_repo; }
- const DocumentType &getDocumentType() const { return *_doc_type; }
+ const DocumentType &getDocumentType() const noexcept { return *_doc_type; }
};
} // namespace document