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:
parent
5ec129971b
commit
4704833357
@ -206,7 +206,7 @@ class WriteBatch : public WriteBatchBase {
|
|||||||
WriteBatch* GetWriteBatch() override { return this; }
|
WriteBatch* GetWriteBatch() override { return this; }
|
||||||
|
|
||||||
// Constructor with a serialized string object
|
// 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:
|
private:
|
||||||
friend class WriteBatchInternal;
|
friend class WriteBatchInternal;
|
||||||
|
Loading…
Reference in New Issue
Block a user