diff options
author | B Stack <bgstack15@gmail.com> | 2018-11-15 11:22:00 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2018-11-15 11:22:00 +0000 |
commit | 77c5c2503d459288720a8894349ac74e5eeec7c6 (patch) | |
tree | 30bf08d782d58174a0ca212b2e4b172fabd9c42c /zen/serialize.h | |
parent | Merge branch '10.5' into 'master' (diff) | |
parent | 10.6 (diff) | |
download | FreeFileSync-77c5c2503d459288720a8894349ac74e5eeec7c6.tar.gz FreeFileSync-77c5c2503d459288720a8894349ac74e5eeec7c6.tar.bz2 FreeFileSync-77c5c2503d459288720a8894349ac74e5eeec7c6.zip |
Merge branch '10.6' into 'master'10.6
10.6
See merge request opensource-tracking/FreeFileSync!3
Diffstat (limited to 'zen/serialize.h')
-rwxr-xr-x | zen/serialize.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/zen/serialize.h b/zen/serialize.h index d34b61b2..8b4c58ea 100755 --- a/zen/serialize.h +++ b/zen/serialize.h @@ -36,20 +36,20 @@ public: using iterator = std::vector<std::byte>::iterator; using const_iterator = std::vector<std::byte>::const_iterator; - iterator begin() { return buffer_->begin(); } - iterator end () { return buffer_->end (); } + iterator begin() { return buffer_.ref().begin(); } + iterator end () { return buffer_.ref().end (); } - const_iterator begin() const { return buffer_->begin(); } - const_iterator end () const { return buffer_->end (); } + const_iterator begin() const { return buffer_.ref().begin(); } + const_iterator end () const { return buffer_.ref().end (); } - void resize(size_t len) { buffer_->resize(len); } - size_t size() const { return buffer_->size(); } - bool empty() const { return buffer_->empty(); } + void resize(size_t len) { buffer_.ref().resize(len); } + size_t size() const { return buffer_.ref().size(); } + bool empty() const { return buffer_.ref().empty(); } - inline friend bool operator==(const ByteArray& lhs, const ByteArray& rhs) { return *lhs.buffer_ == *rhs.buffer_; } + inline friend bool operator==(const ByteArray& lhs, const ByteArray& rhs) { return lhs.buffer_.ref() == rhs.buffer_.ref(); } private: - std::shared_ptr<std::vector<std::byte>> buffer_ = std::make_shared<std::vector<std::byte>>(); //always bound! + SharedRef<std::vector<std::byte>> buffer_ = makeSharedRef<std::vector<std::byte>>(); //perf: shared_ptr indirection irrelevant: less than 1% slower! }; |