mirror of https://github.com/facebook/rocksdb.git
add WriteBatch::WriteBatch(std::string&&)
Summary: to save a string copy for some use cases. The change is pretty straightforward, please feel free to let me know if you want to suggest any tests for it. Closes https://github.com/facebook/rocksdb/pull/3349 Differential Revision: D6706828 Pulled By: yiwu-arbug fbshipit-source-id: 873ce4442937bdc030b395c7f99228eda7f59eb7
This commit is contained in:
parent
d4da02d147
commit
204af1eccc
|
@ -144,6 +144,12 @@ WriteBatch::WriteBatch(const std::string& rep)
|
|||
max_bytes_(0),
|
||||
rep_(rep) {}
|
||||
|
||||
WriteBatch::WriteBatch(std::string&& rep)
|
||||
: save_points_(nullptr),
|
||||
content_flags_(ContentFlags::DEFERRED),
|
||||
max_bytes_(0),
|
||||
rep_(std::move(rep)) {}
|
||||
|
||||
WriteBatch::WriteBatch(const WriteBatch& src)
|
||||
: save_points_(src.save_points_),
|
||||
wal_term_point_(src.wal_term_point_),
|
||||
|
|
|
@ -315,6 +315,7 @@ class WriteBatch : public WriteBatchBase {
|
|||
|
||||
// Constructor with a serialized string object
|
||||
explicit WriteBatch(const std::string& rep);
|
||||
explicit WriteBatch(std::string&& rep);
|
||||
|
||||
WriteBatch(const WriteBatch& src);
|
||||
WriteBatch(WriteBatch&& src) noexcept;
|
||||
|
|
Loading…
Reference in New Issue