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)
This commit is contained in:
jsteemann 2015-09-18 20:20:32 +02:00
parent 5ec129971b
commit 4704833357

View File

@ -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;