diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-03-28 22:33:57 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-03-28 22:33:57 +0200 |
commit | 50339677e91f92ef2ea72ce88627dc1402c275da (patch) | |
tree | 25d15750727409caca3a13e2982e5f2fb0ab5979 /vdslib | |
parent | ddf9abb798e3f6169ba9d04e5025eb4fa1cfe2e6 (diff) |
Move the hasBodyField check to a common place so it is used consistently.
Diffstat (limited to 'vdslib')
-rw-r--r-- | vdslib/src/vespa/vdslib/container/mutabledocumentlist.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
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); } |