From 06f44c7245750bd9d099dba798ceafc10df6b6b4 Mon Sep 17 00:00:00 2001 From: James Strachan Date: Tue, 14 Feb 2006 13:38:09 +0000 Subject: [PATCH] avoid unnecessary comparisons git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@377724 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/transport/stomp/CommandParser.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/CommandParser.java b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/CommandParser.java index 117d0b647a..dba54c0d69 100644 --- a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/CommandParser.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/CommandParser.java @@ -49,21 +49,21 @@ class CommandParser { StompCommand command = null; if (line.startsWith(Stomp.Commands.CONNECT)) command = new Connect(format); - if (line.startsWith(Stomp.Commands.SUBSCRIBE)) + else if (line.startsWith(Stomp.Commands.SUBSCRIBE)) command = new Subscribe(format); - if (line.startsWith(Stomp.Commands.SEND)) + else if (line.startsWith(Stomp.Commands.SEND)) command = new Send(format); - if (line.startsWith(Stomp.Commands.DISCONNECT)) + else if (line.startsWith(Stomp.Commands.DISCONNECT)) command = new Disconnect(); - if (line.startsWith(Stomp.Commands.BEGIN)) + else if (line.startsWith(Stomp.Commands.BEGIN)) command = new Begin(format); - if (line.startsWith(Stomp.Commands.COMMIT)) + else if (line.startsWith(Stomp.Commands.COMMIT)) command = new Commit(format); - if (line.startsWith(Stomp.Commands.ABORT)) + else if (line.startsWith(Stomp.Commands.ABORT)) command = new Abort(format); - if (line.startsWith(Stomp.Commands.UNSUBSCRIBE)) + else if (line.startsWith(Stomp.Commands.UNSUBSCRIBE)) command = new Unsubscribe(format); - if (line.startsWith(Stomp.Commands.ACK)) + else if (line.startsWith(Stomp.Commands.ACK)) command = new Ack(format); if (command == null) {