From 4704833357a8609e7c42df4f337f938a8e870c08 Mon Sep 17 00:00:00 2001 From: jsteemann Date: Fri, 18 Sep 2015 20:20:32 +0200 Subject: [PATCH] pass input string to WriteBatch() by const reference this may lead to copying less data (in case compilers don't optimize away copying the string by themselves) --- include/rocksdb/write_batch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rocksdb/write_batch.h b/include/rocksdb/write_batch.h index e0949b51d..d61ff8c0e 100644 --- a/include/rocksdb/write_batch.h +++ b/include/rocksdb/write_batch.h @@ -206,7 +206,7 @@ class WriteBatch : public WriteBatchBase { WriteBatch* GetWriteBatch() override { return this; } // Constructor with a serialized string object - explicit WriteBatch(std::string rep) : save_points_(nullptr), rep_(rep) {} + explicit WriteBatch(const std::string& rep) : save_points_(nullptr), rep_(rep) {} private: friend class WriteBatchInternal;