You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by ji...@apache.org on 2021/04/12 02:05:36 UTC
[rocketmq] branch develop updated: [ISSUE #2729] Replace with
Math.min method call
This is an automated email from the ASF dual-hosted git repository.
jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new af8a964 [ISSUE #2729] Replace with Math.min method call
af8a964 is described below
commit af8a9648c75d3dac5a7e7fcd0d8047d41456d96d
Author: drgnchan <40...@users.noreply.github.com>
AuthorDate: Sun Apr 11 21:05:16 2021 -0500
[ISSUE #2729] Replace with Math.min method call
---
.../java/org/apache/rocketmq/broker/topic/TopicConfigManager.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/broker/src/main/java/org/apache/rocketmq/broker/topic/TopicConfigManager.java b/broker/src/main/java/org/apache/rocketmq/broker/topic/TopicConfigManager.java
index 99ba1da..1f2bb4d 100644
--- a/broker/src/main/java/org/apache/rocketmq/broker/topic/TopicConfigManager.java
+++ b/broker/src/main/java/org/apache/rocketmq/broker/topic/TopicConfigManager.java
@@ -176,9 +176,7 @@ public class TopicConfigManager extends ConfigManager {
if (PermName.isInherited(defaultTopicConfig.getPerm())) {
topicConfig = new TopicConfig(topic);
- int queueNums =
- clientDefaultTopicQueueNums > defaultTopicConfig.getWriteQueueNums() ? defaultTopicConfig
- .getWriteQueueNums() : clientDefaultTopicQueueNums;
+ int queueNums = Math.min(clientDefaultTopicQueueNums, defaultTopicConfig.getWriteQueueNums());
if (queueNums < 0) {
queueNums = 0;