From 66a99fb5807a7057d068c4c84c9fb38b437135ba Mon Sep 17 00:00:00 2001 From: "Timothy A. Bish" Date: Wed, 5 Jun 2013 14:38:04 +0000 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-4571 unroll the loop. git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1489888 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/broker/region/DestinationFilter.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/DestinationFilter.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/DestinationFilter.java index a7613ef2d1..ecf6cf75d0 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/DestinationFilter.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/DestinationFilter.java @@ -389,12 +389,11 @@ public class DestinationFilter implements Destination { } public void deleteSubscription(ConnectionContext context, SubscriptionKey key) throws Exception { - Destination target = next; - while (target instanceof DestinationFilter) { - target = ((DestinationFilter) target).next; - } - if (target instanceof Topic) { - Topic topic = (Topic)target; + if (next instanceof DestinationFilter) { + DestinationFilter filter = (DestinationFilter) next; + filter.deleteSubscription(context, key); + } else if (next instanceof Topic) { + Topic topic = (Topic)next; topic.deleteSubscription(context, key); } }