Skip to content

Commit

Permalink
[ISSUE alibaba#1576] Delete redundant if statment in select MessageQu…
Browse files Browse the repository at this point in the history
…eue (alibaba#1607)

* delete redundant if statment

* Correct code style
  • Loading branch information
ShadowySpirits authored Jul 29, 2020
1 parent 3e5008f commit 30766d2
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -64,10 +64,8 @@ public MessageQueue selectOneMessageQueue(final TopicPublishInfo tpInfo, final S
if (pos < 0)
pos = 0;
MessageQueue mq = tpInfo.getMessageQueueList().get(pos);
if (latencyFaultTolerance.isAvailable(mq.getBrokerName())) {
if (null == lastBrokerName || mq.getBrokerName().equals(lastBrokerName))
return mq;
}
if (latencyFaultTolerance.isAvailable(mq.getBrokerName()))
return mq;
}

final String notBestBroker = latencyFaultTolerance.pickOneAtLeast();

0 comments on commit 30766d2

Please sign in to comment.