summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-06-15 13:47:01 +0200
committerHenning Baldersheim <balder@oath.com>2018-06-15 13:47:01 +0200
commitd08be54730d8cf935e79e15e6d20cd026e5ae357 (patch)
treedc14f6a8a1adeab23b2a088e921f8bd44104094d /document
parentd1cd24418868a0cdce0cf199fa0a88afec9cd3cc (diff)
Reuse common code
Diffstat (limited to 'document')
-rw-r--r--document/src/vespa/document/update/documentupdate.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/document/src/vespa/document/update/documentupdate.cpp b/document/src/vespa/document/update/documentupdate.cpp
index 887c8dbf568..d23165cc815 100644
--- a/document/src/vespa/document/update/documentupdate.cpp
+++ b/document/src/vespa/document/update/documentupdate.cpp
@@ -36,7 +36,7 @@ readCStr(nbostream & stream) {
std::pair<const DocumentType *, DocumentId>
deserializeTypeAndId(const DocumentTypeRepo& repo, vespalib::nbostream & stream) {
- DocumentId docId(stream);
+ DocumentId docId(readCStr(stream));
// Read content bit vector.
unsigned char content = 0x00;
@@ -63,9 +63,7 @@ deserializeTypeAndId(const DocumentTypeRepo& repo, vespalib::nbostream & stream)
const DocumentType *
deserializeHeader(const DocumentTypeRepo &repo, vespalib::nbostream & stream, vespalib::stringref & documentId)
{
- size_t sz = strnlen(stream.peek(), stream.size());
- documentId = vespalib::stringref(stream.peek(), sz);
- stream.adjustReadPos(sz + 1);
+ documentId = readCStr(stream);
vespalib::stringref typestr = readCStr(stream);
int16_t version = 0;
stream >> version;