Implement CopyOnWriteBuffer move using scoped_refptr move

instead of using temporary swap solution.

BUG=webrtc:5556

Review-Url: https://codereview.webrtc.org/2191863002
Cr-Commit-Position: refs/heads/master@{#13582}
This commit is contained in:
danilchap
2016-07-30 12:39:26 -07:00
committed by Commit bot
parent 76a44d5daf
commit d8a9c5306b
2 changed files with 3 additions and 6 deletions

View File

@ -20,9 +20,8 @@ CopyOnWriteBuffer::CopyOnWriteBuffer(const CopyOnWriteBuffer& buf)
: buffer_(buf.buffer_) {
}
CopyOnWriteBuffer::CopyOnWriteBuffer(CopyOnWriteBuffer&& buf) {
// TODO(jbauch): use std::move once scoped_refptr supports it (issue 5556)
std::swap(buffer_, buf.buffer_);
CopyOnWriteBuffer::CopyOnWriteBuffer(CopyOnWriteBuffer&& buf)
: buffer_(std::move(buf.buffer_)) {
}
CopyOnWriteBuffer::CopyOnWriteBuffer(size_t size)