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 2021/06/02 04:54:24 UTC

[james-project] 03/04: [PERFORMANCE] MailboxACL.union shortcuts

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 76e540f75d12dd9375a1732773e6264d23361271
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun May 30 10:23:55 2021 +0700

    [PERFORMANCE] MailboxACL.union shortcuts
---
 .../api/src/main/java/org/apache/james/mailbox/model/MailboxACL.java   | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxACL.java b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxACL.java
index 5fb6637..65daef9 100644
--- a/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxACL.java
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxACL.java
@@ -859,6 +859,9 @@ public class MailboxACL {
      * one of those.
      */
     public MailboxACL union(MailboxACL other) throws UnsupportedRightException {
+        if (entries.isEmpty()) {
+            return other;
+        }
         return new MailboxACL(
             Stream.concat(
                     this.entries.entrySet().stream(),

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