mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 18:55:10 +01:00
To insert to associateive STL containers value_type used instead of make_pair
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
parent
f9e6d94be5
commit
b7386f5b50
@ -247,8 +247,8 @@ int zmq::ctx_t::register_endpoint (const char *addr_,
|
||||
{
|
||||
endpoints_sync.lock ();
|
||||
|
||||
bool inserted = endpoints.insert (std::make_pair (std::string (addr_),
|
||||
socket_)).second;
|
||||
bool inserted = endpoints.insert (endpoints_t::value_type (
|
||||
std::string (addr_), socket_)).second;
|
||||
if (!inserted) {
|
||||
errno = EADDRINUSE;
|
||||
endpoints_sync.unlock ();
|
||||
|
@ -179,7 +179,7 @@ void zmq::pgm_receiver_t::in_event ()
|
||||
// New peer. Add it to the list of know but unjoint peers.
|
||||
if (it == peers.end ()) {
|
||||
peer_info_t peer_info = {false, NULL};
|
||||
it = peers.insert (std::make_pair (*tsi, peer_info)).first;
|
||||
it = peers.insert (peers_t::value_type (*tsi, peer_info)).first;
|
||||
}
|
||||
|
||||
// Read the offset of the fist message in the current packet.
|
||||
|
@ -562,7 +562,7 @@ bool zmq::socket_base_t::register_session (const blob_t &name_,
|
||||
{
|
||||
sessions_sync.lock ();
|
||||
bool registered = sessions.insert (
|
||||
std::make_pair (name_, session_)).second;
|
||||
sessions_t::value_type (name_, session_)).second;
|
||||
sessions_sync.unlock ();
|
||||
return registered;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ void zmq::xrep_t::xattach_pipes (reader_t *inpipe_, writer_t *outpipe_,
|
||||
|
||||
// TODO: What if new connection has same peer identity as the old one?
|
||||
outpipe_t outpipe = {outpipe_, true};
|
||||
bool ok = outpipes.insert (std::make_pair (
|
||||
bool ok = outpipes.insert (outpipes_t::value_type (
|
||||
peer_identity_, outpipe)).second;
|
||||
zmq_assert (ok);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user