From 0b541b789a1aa7d78b96acfbbf92b9ad2f6ab171 Mon Sep 17 00:00:00 2001 From: Pavel Pimenov Date: Thu, 9 Oct 2014 09:37:55 +0400 Subject: [PATCH 1/3] Fix V803 Decreased performance. In case 'it' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. stream_engine.cpp http://www.viva64.com/en/d/0165/print/ --- src/stream_engine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stream_engine.cpp b/src/stream_engine.cpp index ed342150d..60a269079 100644 --- a/src/stream_engine.cpp +++ b/src/stream_engine.cpp @@ -781,7 +781,7 @@ void zmq::stream_engine_t::mechanism_ready () it = zap_properties.begin (); while (it != zap_properties.end ()) { properties.insert (properties_t::value_type (it->first, it->second)); - it++; + ++it; } // Add ZMTP properties. @@ -789,7 +789,7 @@ void zmq::stream_engine_t::mechanism_ready () it = zmtp_properties.begin (); while (it != zmtp_properties.end ()) { properties.insert (properties_t::value_type (it->first, it->second)); - it++; + ++it; } zmq_assert (metadata == NULL); From 0e3d40c806eadb4d1f5d519de3c176ddeb11d265 Mon Sep 17 00:00:00 2001 From: Pavel Pimenov Date: Thu, 9 Oct 2014 09:40:59 +0400 Subject: [PATCH 2/3] Fix V815 Decreased performance. Consider replacing the expression 'options.socks_proxy_address != ""' with '!options.socks_proxy_address.empty()'. session_base.cpp 497 --- src/session_base.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/session_base.cpp b/src/session_base.cpp index 319058c4d..44942ec3d 100644 --- a/src/session_base.cpp +++ b/src/session_base.cpp @@ -494,7 +494,7 @@ void zmq::session_base_t::start_connecting (bool wait_) // Create the connecter object. if (addr->protocol == "tcp") { - if (options.socks_proxy_address != "") { + if (!options.socks_proxy_address.empty()) { address_t *proxy_address = new (std::nothrow) address_t ("tcp", options.socks_proxy_address); alloc_assert (proxy_address); From 18ee219ce753228ad0118c76168b549504e2d505 Mon Sep 17 00:00:00 2001 From: Pavel Pimenov Date: Thu, 9 Oct 2014 09:41:49 +0400 Subject: [PATCH 3/3] Fix V815 Decreased performance. Consider replacing the expression 'peer_address = ""' with 'peer_address.clear()'. stream_engine.cpp 99 --- src/stream_engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream_engine.cpp b/src/stream_engine.cpp index 60a269079..920b8acb5 100644 --- a/src/stream_engine.cpp +++ b/src/stream_engine.cpp @@ -96,7 +96,7 @@ zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_, int family = get_peer_ip_address (s, peer_address); if (family == 0) - peer_address = ""; + peer_address.clear(); #if defined ZMQ_HAVE_SO_PEERCRED else if (family == PF_UNIX) {