This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new e97fd2c CAMEL-16462: camel-core - Optimize Multicast EIP to reduce object allocations. e97fd2c is described below commit e97fd2c700d936434b67f275932651ba10605252 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Wed Apr 7 17:23:06 2021 +0200 CAMEL-16462: camel-core - Optimize Multicast EIP to reduce object allocations. --- .../src/main/java/org/apache/camel/processor/MulticastProcessor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/camel-core-processor/src/main/java/org/apache/camel/processor/MulticastProcessor.java b/core/camel-core-processor/src/main/java/org/apache/camel/processor/MulticastProcessor.java index 0d2eaba..cf76c89 100644 --- a/core/camel-core-processor/src/main/java/org/apache/camel/processor/MulticastProcessor.java +++ b/core/camel-core-processor/src/main/java/org/apache/camel/processor/MulticastProcessor.java @@ -307,10 +307,12 @@ public class MulticastProcessor extends AsyncProcessorSupport @Override public boolean process(Exchange exchange, AsyncCallback callback) { Iterable<ProcessorExchangePair> pairs; - // TODO: optimize size int size = 0; try { pairs = createProcessorExchangePairs(exchange); + if (pairs instanceof Collection) { + size = ((Collection<ProcessorExchangePair>) pairs).size(); + } } catch (Throwable e) { exchange.setException(e); // unexpected exception was thrown, maybe from iterator etc. so do not regard as exhausted