From bde999bba1e0eb043c73c2f5e144e29918cf91bd Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期四, 30 十二月 2021 17:50:55 +0800
Subject: [PATCH] performance

---
 src/nng_wrap.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/nng_wrap.cpp b/src/nng_wrap.cpp
index bf1fa01..87709b8 100644
--- a/src/nng_wrap.cpp
+++ b/src/nng_wrap.cpp
@@ -209,12 +209,12 @@
             if (m_len > 0){
                 string tmp_msg{m, (size_t)m_len};
                 nn_freemsg(m);
-                auto topic{tmp_msg.c_str()};
+                const auto topic{tmp_msg.c_str()};
                 string msg{};
                 {
                     lock_guard<mutex> l{(*sub)()};
                     for(auto && i : sub->topics_){
-                        if (i.compare(topic) == 0){
+                        if (!!!i.compare(topic)){
                             msg = move(tmp_msg.substr(i.size()+1));
                             break;
                         }

--
Gitblit v1.8.0