remove needless find()
This commit is contained in:
parent
1d5372d432
commit
8f4483dfea
1 changed files with 11 additions and 6 deletions
|
|
@ -1260,13 +1260,11 @@ namespace graphene { namespace net { namespace detail {
|
|||
wdump((inventory_to_advertise));
|
||||
for (const item_id& item_to_advertise : inventory_to_advertise)
|
||||
{
|
||||
if (peer->inventory_advertised_to_peer.find(item_to_advertise) != peer->inventory_advertised_to_peer.end() )
|
||||
wdump((*peer->inventory_advertised_to_peer.find(item_to_advertise)));
|
||||
if (peer->inventory_peer_advertised_to_us.find(item_to_advertise) != peer->inventory_peer_advertised_to_us.end() )
|
||||
wdump((*peer->inventory_peer_advertised_to_us.find(item_to_advertise)));
|
||||
auto adv_to_peer = peer->inventory_advertised_to_peer.find(item_to_advertise);
|
||||
auto adv_to_us = peer->inventory_peer_advertised_to_us.find(item_to_advertise);
|
||||
|
||||
if (peer->inventory_advertised_to_peer.find(item_to_advertise) == peer->inventory_advertised_to_peer.end() &&
|
||||
peer->inventory_peer_advertised_to_us.find(item_to_advertise) == peer->inventory_peer_advertised_to_us.end())
|
||||
if (adv_to_peer == peer->inventory_advertised_to_peer.end() &&
|
||||
adv_to_us == peer->inventory_peer_advertised_to_us.end())
|
||||
{
|
||||
items_to_advertise_by_type[item_to_advertise.item_type].push_back(item_to_advertise.item_hash);
|
||||
peer->inventory_advertised_to_peer.insert(peer_connection::timestamped_item_id(item_to_advertise, fc::time_point::now()));
|
||||
|
|
@ -1275,6 +1273,13 @@ namespace graphene { namespace net { namespace detail {
|
|||
testnetlog("advertising transaction ${id} to peer ${endpoint}", ("id", item_to_advertise.item_hash)("endpoint", peer->get_remote_endpoint()));
|
||||
dlog("advertising item ${id} to peer ${endpoint}", ("id", item_to_advertise.item_hash)("endpoint", peer->get_remote_endpoint()));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (adv_to_peer != peer->inventory_advertised_to_peer.end() )
|
||||
wdump( (*adv_to_peer) );
|
||||
if (adv_to_us != peer->inventory_peer_advertised_to_us.end() )
|
||||
wdump( (*adv_to_us) );
|
||||
}
|
||||
}
|
||||
dlog("advertising ${count} new item(s) of ${types} type(s) to peer ${endpoint}",
|
||||
("count", total_items_to_send_to_this_peer)
|
||||
|
|
|
|||
Loading…
Reference in a new issue