summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-02-05 11:27:21 +0100
committerHenning Baldersheim <balder@oath.com>2018-02-05 11:27:21 +0100
commit859312c53a1e8ceb8211af908b1509caacfe948a (patch)
tree314ae7af490b888eaf965ecc38aa5505846ba967 /searchlib
parent6a2dbe14a4dc52b25ca1d100728dd4a0f6c08091 (diff)
No need to compress just to uncompress.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/docstore/documentstore.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/searchlib/src/vespa/searchlib/docstore/documentstore.cpp b/searchlib/src/vespa/searchlib/docstore/documentstore.cpp
index 42920a093eb..6345e414b99 100644
--- a/searchlib/src/vespa/searchlib/docstore/documentstore.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/documentstore.cpp
@@ -88,6 +88,8 @@ public:
* value along with compression config.
*/
void set(vespalib::DataBuffer &&buf, ssize_t len, const CompressionConfig &compression);
+ // Keep buffer uncompressed
+ void set(vespalib::DataBuffer &&buf, ssize_t len);
/**
* Decompress value into temporary buffer and deserialize document from
@@ -125,6 +127,12 @@ private:
CompressionConfig _compression;
};
+
+void
+Value::set(vespalib::DataBuffer &&buf, ssize_t len) {
+ set(std::move(buf), len, CompressionConfig());
+}
+
void
Value::set(vespalib::DataBuffer &&buf, ssize_t len, const CompressionConfig &compression) {
//Underlying buffer must be identical to allow swap.
@@ -436,7 +444,7 @@ DocumentStore::WrapVisitor<Visitor>::visit(uint32_t lid,
buf.writeBytes(buffer, sz);
ssize_t len = sz;
if (len > 0) {
- value.set(std::move(buf), len, _compression);
+ value.set(std::move(buf), len);
}
if (! value.empty()) {
document::Document::UP doc(value.deserializeDocument(_repo));