You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/10/29 04:08:42 UTC
[GitHub] [rocketmq] caigy commented on a diff in pull request #5416: [ISSUE #5415]fix duplicate records
caigy commented on code in PR #5416:
URL: https://github.com/apache/rocketmq/pull/5416#discussion_r1008627063
##########
broker/src/main/java/org/apache/rocketmq/broker/transaction/queue/TransactionalMessageBridge.java:
##########
@@ -303,9 +303,7 @@ private TopicConfig selectTopicConfig(String topic) {
public boolean writeOp(Integer queueId,Message message) {
MessageQueue opQueue;
- if (opQueueMap.containsKey(queueId)) {
- opQueue = opQueueMap.get(queueId);
- } else {
+ if ((opQueue = opQueueMap.get(queueId)) == null) {
Review Comment:
Assigning `opQueue` at first may be better than initializing it in `if` condition.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org