From: Jianpeng Ma Date: Wed, 25 Oct 2017 16:16:45 +0000 (+0800) Subject: msg/async: remove redundant condition. X-Git-Tag: v13.0.1~412^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2371b149e004975ce8632006c8620d6d38e38542;p=ceph-ci.git msg/async: remove redundant condition. From the code, if out_q[r].is_empty, it already remove. Signed-off-by: Jianpeng Ma --- diff --git a/src/msg/async/AsyncConnection.h b/src/msg/async/AsyncConnection.h index e9a22d739a6..d337a7eea9d 100644 --- a/src/msg/async/AsyncConnection.h +++ b/src/msg/async/AsyncConnection.h @@ -113,17 +113,16 @@ class AsyncConnection : public Connection { } Message *_get_next_outgoing(bufferlist *bl) { Message *m = 0; - while (!m && !out_q.empty()) { + if (!out_q.empty()) { map > >::reverse_iterator it = out_q.rbegin(); - if (!it->second.empty()) { - list >::iterator p = it->second.begin(); - m = p->second; - if (bl) - bl->swap(p->first); - it->second.erase(p); - } + assert(!it->second.empty()); + list >::iterator p = it->second.begin(); + m = p->second; + if (bl) + bl->swap(p->first); + it->second.erase(p); if (it->second.empty()) - out_q.erase(it->first); + out_q.erase(it->first); } return m; }