summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2020-10-08 12:01:25 +0000
committerTor Brede Vekterli <vekterli@verizonmedia.com>2020-10-08 12:01:25 +0000
commit2f289794b28c09b77ee9b7fe0066fca25a8549c1 (patch)
treea9dc93ade9a25fbba0597c5d3be3a181890e7fd9 /document
parent079c648dc2c8b3aad65c902183bce2e40bfee8cb (diff)
Make vespalib hash functors noexcept
Make ducktyped functor conditionally noexcept on `hash()` member function. Follow up on `-Werror=noexcept` warnings indicating where `noexcept` can be trivially added for such functions.
Diffstat (limited to 'document')
-rw-r--r--document/src/vespa/document/base/field.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/document/src/vespa/document/base/field.h b/document/src/vespa/document/base/field.h
index 613fcd9df1b..3a0c9b82136 100644
--- a/document/src/vespa/document/base/field.h
+++ b/document/src/vespa/document/base/field.h
@@ -97,13 +97,13 @@ public:
const DataType &getDataType() const { return *_dataType; }
- int getId() const { return _fieldId; }
+ int getId() const noexcept { return _fieldId; }
vespalib::string toString(bool verbose=false) const;
bool contains(const FieldSet& fields) const override;
Type getType() const override { return Type::FIELD; }
bool valid() const { return _fieldId != 0; }
- uint32_t hash() const { return getId(); }
+ uint32_t hash() const noexcept { return getId(); }
private:
int calculateIdV7();