more use of emplace_back in chained_buffer

This commit is contained in:
Alden Torres 2018-03-03 09:32:14 -05:00 committed by Arvid Norberg
parent 80f5edc500
commit 448de4ca14
1 changed files with 2 additions and 2 deletions

View File

@ -137,11 +137,11 @@ namespace libtorrent {
if (i->used_size > bytes) if (i->used_size > bytes)
{ {
TORRENT_ASSERT(bytes > 0); TORRENT_ASSERT(bytes > 0);
vec.push_back(Buffer(i->buf, std::size_t(bytes))); vec.emplace_back(i->buf, std::size_t(bytes));
break; break;
} }
TORRENT_ASSERT(i->used_size > 0); TORRENT_ASSERT(i->used_size > 0);
vec.push_back(Buffer(i->buf, std::size_t(i->used_size))); vec.emplace_back(i->buf, std::size_t(i->used_size));
bytes -= i->used_size; bytes -= i->used_size;
} }
} }