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)
main
jsteemann 9 years ago
parent 5ec129971b
commit 4704833357
  1. 2
      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;

Loading…
Cancel
Save