Skip to content

Commit ab9c8ad

Browse files
committed
Drop clang emplace_back workaround.
1 parent 5316fb7 commit ab9c8ad

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/protocols/protocol_block_in.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,13 @@ get_blocks protocol_block_in::create_get_inventory(
248248
get_data protocol_block_in::create_get_data(
249249
const inventory& message) const NOEXCEPT
250250
{
251-
// clang emplace_back bug (no matching constructor), using push_back.
252251
// bip144: get_data uses witness constant but inventory does not.
253252

254253
get_data getter{};
255254
getter.items.reserve(message.count(type_id::block));
256255
for (const messages::inventory_item& item: message.items)
257256
if ((item.type == type_id::block) && !archive().is_block(item.hash))
258-
getter.items.push_back({ block_type_, item.hash });
257+
getter.items.emplace_back(block_type_, item.hash);
259258

260259
getter.items.shrink_to_fit();
261260
return getter;

src/protocols/protocol_block_in_31800.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,9 @@ get_data protocol_block_in_31800::create_get_data(
257257
data.items.reserve(map.size());
258258

259259
// bip144: get_data uses witness constant but inventory does not.
260-
// clang emplace_back bug (no matching constructor), using push_back.
261260
std::for_each(map.pos_begin(), map.pos_end(), [&](const auto& item) NOEXCEPT
262261
{
263-
data.items.push_back({ block_type_, item.hash });
262+
data.items.emplace_back(block_type_, item.hash);
264263
});
265264

266265
return data;

0 commit comments

Comments
 (0)