unroll the loop. 

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1489888 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2013-06-05 14:38:04 +00:00
parent 767a59dfc4
commit 66a99fb580
1 changed files with 5 additions and 6 deletions

View File

@ -389,12 +389,11 @@ public class DestinationFilter implements Destination {
} }
public void deleteSubscription(ConnectionContext context, SubscriptionKey key) throws Exception { public void deleteSubscription(ConnectionContext context, SubscriptionKey key) throws Exception {
Destination target = next; if (next instanceof DestinationFilter) {
while (target instanceof DestinationFilter) { DestinationFilter filter = (DestinationFilter) next;
target = ((DestinationFilter) target).next; filter.deleteSubscription(context, key);
} } else if (next instanceof Topic) {
if (target instanceof Topic) { Topic topic = (Topic)next;
Topic topic = (Topic)target;
topic.deleteSubscription(context, key); topic.deleteSubscription(context, key);
} }
} }