From af8a9648c75d3dac5a7e7fcd0d8047d41456d96d Mon Sep 17 00:00:00 2001 From: drgnchan <40224023+drgnchan@users.noreply.github.com> Date: Sun, 11 Apr 2021 21:05:16 -0500 Subject: [PATCH] [ISSUE #2729] Replace with Math.min method call --- .../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 99ba1da3..1f2bb4d8 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; -- GitLab