diff options
Diffstat (limited to 'document')
-rw-r--r-- | document/src/vespa/document/update/documentupdate.cpp | 8 | ||||
-rw-r--r-- | document/src/vespa/document/update/documentupdate.h | 6 |
2 files changed, 6 insertions, 8 deletions
diff --git a/document/src/vespa/document/update/documentupdate.cpp b/document/src/vespa/document/update/documentupdate.cpp index d6488c1381c..6ab01a4d3ff 100644 --- a/document/src/vespa/document/update/documentupdate.cpp +++ b/document/src/vespa/document/update/documentupdate.cpp @@ -87,15 +87,10 @@ DocumentUpdate::operator==(const DocumentUpdate& other) const } const DocumentType& -DocumentUpdate::getType() const { +DocumentUpdate::getType() const noexcept { return static_cast<const DocumentType &> (*_type); } -const DocumentTypeRepo* -DocumentUpdate::getRepoPtr() const noexcept { - return _repo; -} - const DocumentUpdate::FieldUpdateV & DocumentUpdate::getUpdates() const { ensureDeserialized(); @@ -266,6 +261,7 @@ DocumentUpdate::initHEAD(const DocumentTypeRepo & repo, vespalib::nbostream && s void DocumentUpdate::initHEAD(const DocumentTypeRepo & repo, vespalib::nbostream & stream) { + _repo = &repo; size_t startPos = stream.rp(); vespalib::stringref docId; _type = deserializeHeader(repo, stream, docId); diff --git a/document/src/vespa/document/update/documentupdate.h b/document/src/vespa/document/update/documentupdate.h index 5a7944b1188..d554e66bd1a 100644 --- a/document/src/vespa/document/update/documentupdate.h +++ b/document/src/vespa/document/update/documentupdate.h @@ -99,10 +99,12 @@ public: void eagerDeserialize() const; /** @return The type of document this update is for. */ - const DocumentType& getType() const; + const DocumentType& getType() const noexcept; // Returns pointer to repo used for underlying update, or nullptr if default-constructed - const DocumentTypeRepo* getRepoPtr() const noexcept; + const DocumentTypeRepo* getRepoPtr() const noexcept { + return _repo; + } void serializeHEAD(vespalib::nbostream &stream) const; |