kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmcc...@apache.org
Subject [kafka] 05/06: Update shell/src/main/java/org/apache/kafka/shell/CommandUtils.java
Date Thu, 11 Feb 2021 17:57:15 GMT
This is an automated email from the ASF dual-hosted git repository.

cmccabe pushed a commit to branch metashell
in repository https://gitbox.apache.org/repos/asf/kafka.git

commit f8f5d0df60491d80b0df38b7e00065d2ef4d4e6c
Author: Colin Patrick McCabe <colin@cmccabe.xyz>
AuthorDate: Thu Feb 11 09:55:09 2021 -0800

    Update shell/src/main/java/org/apache/kafka/shell/CommandUtils.java
    
    Co-authored-by: Igor Soarez <i@soarez.me>
---
 shell/src/main/java/org/apache/kafka/shell/CommandUtils.java | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/shell/src/main/java/org/apache/kafka/shell/CommandUtils.java b/shell/src/main/java/org/apache/kafka/shell/CommandUtils.java
index 8e5bc21..0639172 100644
--- a/shell/src/main/java/org/apache/kafka/shell/CommandUtils.java
+++ b/shell/src/main/java/org/apache/kafka/shell/CommandUtils.java
@@ -58,10 +58,7 @@ public final class CommandUtils {
      */
     public static void completeCommand(String commandPrefix, List<Candidate> candidates)
{
         String command = Commands.TYPES.ceilingKey(commandPrefix);
-        while (true) {
-            if (command == null || !command.startsWith(commandPrefix)) {
-                return;
-            }
+        while (command != null && command.startsWith(commandPrefix)) {
             candidates.add(new Candidate(command));
             command = Commands.TYPES.higherKey(command);
         }


Mime
View raw message