summaryrefslogtreecommitdiff
path: root/zen/serialize.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2018-11-13 06:58:56 -0500
committerB Stack <bgstack15@gmail.com>2018-11-13 06:58:56 -0500
commit076498028ff511afd88d93e7b0bf1d1a81093b3d (patch)
tree30bf08d782d58174a0ca212b2e4b172fabd9c42c /zen/serialize.h
parentMerge branch '10.5' into 'master' (diff)
downloadFreeFileSync-076498028ff511afd88d93e7b0bf1d1a81093b3d.tar.gz
FreeFileSync-076498028ff511afd88d93e7b0bf1d1a81093b3d.tar.bz2
FreeFileSync-076498028ff511afd88d93e7b0bf1d1a81093b3d.zip
10.6
Diffstat (limited to 'zen/serialize.h')
-rwxr-xr-xzen/serialize.h18
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!
};
bgstack15