From 50339677e91f92ef2ea72ce88627dc1402c275da Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 28 Mar 2017 22:33:57 +0200 Subject: Move the hasBodyField check to a common place so it is used consistently. --- .../vespa/vdslib/container/mutabledocumentlist.cpp | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'vdslib') diff --git a/vdslib/src/vespa/vdslib/container/mutabledocumentlist.cpp b/vdslib/src/vespa/vdslib/container/mutabledocumentlist.cpp index 6ceffa9cff7..1c80e3ba8ee 100644 --- a/vdslib/src/vespa/vdslib/container/mutabledocumentlist.cpp +++ b/vdslib/src/vespa/vdslib/container/mutabledocumentlist.cpp @@ -6,23 +6,6 @@ using vespalib::nbostream; -namespace { - -bool hasBodyField(const document::Document & value) { - for (document::StructuredFieldValue::const_iterator it(value.getFields().begin()), mt(value.getFields().end()); - it != mt; - ++it) - { - if ( ! it.field().isHeaderField() ) { - return true; - } - } - return false; -} - -} - - namespace vdslib { MutableDocumentList::MutableDocumentList(const document::DocumentTypeRepo::SP & repo, char* buffer, uint32_t bufferSize, bool keepexisting) : DocumentList(repo, buffer, bufferSize, keepexisting) @@ -66,7 +49,7 @@ MutableDocumentList::addPut(const document::Document& doc, Timestamp ts, doc.serializeHeader(stream); uint32_t headerSize = stream.size(); - if (addBody && hasBodyField(doc)) { + if (addBody) { doc.serializeBody(stream); } -- cgit v1.2.3