james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1149469 - /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
Date Fri, 22 Jul 2011 05:33:51 GMT
Author: norman
Date: Fri Jul 22 05:33:50 2011
New Revision: 1149469

URL: http://svn.apache.org/viewvc?rev=1149469&view=rev
Log:
allow to optimize flags updates by building better MessageRanges

Modified:
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java

Modified: james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java?rev=1149469&r1=1149468&r2=1149469&view=diff
==============================================================================
--- james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
(original)
+++ james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
Fri Jul 22 05:33:50 2011
@@ -211,10 +211,11 @@ abstract public class AbstractMailboxPro
             
             final Collection<Long> flagUpdateUids = selected.flagUpdateUids();
             if (!flagUpdateUids.isEmpty()) {
-                for (final Long uid : flagUpdateUids) {
-                    MessageRange messageSet = MessageRange.one(uid.longValue());
-                    addFlagsResponses(session, selected, responder, useUid, messageSet, mailbox,
mailboxSession);
-                }
+            	Iterator<MessageRange> ranges = MessageRange.toRanges(flagUpdateUids).iterator();
+            	while(ranges.hasNext()) {
+            		addFlagsResponses(session, selected, responder, useUid, ranges.next(), mailbox,
mailboxSession);
+            	}
+
             }
         } catch (MailboxException e) {
             handleResponseException(responder, e, HumanReadableText.FAILURE_TO_LOAD_FLAGS,
session);



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


Mime
View raw message