You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2022/03/16 01:18:41 UTC

[james-project] 11/11: [PERF] FetchData::toString avoid a needless copy

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 06a693b11284e49b5dee948a5e3677fe29f6e473
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Mar 11 09:26:16 2022 +0700

    [PERF] FetchData::toString avoid a needless copy
    
    We are already working with an immutable collection, no need to copy it.
---
 .../src/main/java/org/apache/james/imap/api/message/FetchData.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/protocols/imap/src/main/java/org/apache/james/imap/api/message/FetchData.java b/protocols/imap/src/main/java/org/apache/james/imap/api/message/FetchData.java
index 822dfa2..047387b 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/api/message/FetchData.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/api/message/FetchData.java
@@ -106,7 +106,7 @@ public class FetchData {
     }
 
     private final EnumSet<Item> itemToFetch;
-    private final Set<BodyFetchElement> bodyElements;
+    private final ImmutableSet<BodyFetchElement> bodyElements;
     private final boolean setSeen;
     private final long changedSince;
     private final boolean vanished;
@@ -181,7 +181,7 @@ public class FetchData {
             .add("body", contains(Item.BODY))
             .add("bodyStructure", contains(Item.BODY_STRUCTURE))
             .add("setSeen", setSeen)
-            .add("bodyElements", ImmutableSet.copyOf(bodyElements))
+            .add("bodyElements", bodyElements)
             .add("modSeq", contains(Item.MODSEQ))
             .add("changedSince", changedSince)
             .add("vanished", vanished)

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org