RapperCL commented on code in PR #5416:
URL: https://github.com/apache/rocketmq/pull/5416#discussion_r1008649959
##########
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:
Ok, I think this can reduce one query, although the time complexity is only
O(1) and I don't think it's a good practice to judge first and then get it. If
the opQueueMap has a removal operation, there will be problems.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]