This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 1636eca5a2010bd7244641f1cbd94a2e1b6e757f Author: Benoit Tellier <[email protected]> AuthorDate: Mon Jun 21 14:48:48 2021 +0700 [PERFORMANCE] MessageViewFactory::hasOnlyOneMessageId shortcut on single value This takes 0.20% of CPU and represents 0.34% of memory allocation... --- .../apache/james/jmap/draft/model/message/view/MessageViewFactory.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/message/view/MessageViewFactory.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/message/view/MessageViewFactory.java index a720019..3333bca 100644 --- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/message/view/MessageViewFactory.java +++ b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/message/view/MessageViewFactory.java @@ -80,6 +80,9 @@ public interface MessageViewFactory<T extends MessageView> { } private static boolean hasOnlyOneMessageId(Collection<MessageResult> messageResults) { + if (messageResults.size() == 1) { + return true; + } return messageResults .stream() .map(MessageResult::getMessageId) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
