Avoid copying array every time, just slice it

Suggested-by: Josh Berry
Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
This commit is contained in:
Eygene Ryabinkin 2014-07-10 10:24:11 +04:00
parent 1f2e8af8aa
commit aa55b38e26
2 changed files with 5 additions and 3 deletions

View File

@ -17,6 +17,8 @@ OfflineIMAP v6.5.6.1 (YYYY-MM-DD)
* Various fixes in documentation.
* Fix unbounded recursion during flag update (Josh Berry).
OfflineIMAP v6.5.6 (2014-05-14)
===============================

View File

@ -801,9 +801,9 @@ class IMAPFolder(BaseFolder):
def __processmessagesflags(self, operation, uidlist, flags):
# Hack for those IMAP servers with a limited line length
batch_size = 100
while len(uidlist):
self.__processmessagesflags_real(operation, uidlist[:batch_size], flags)
uidlist = uidlist[batch_size:]
for i in xrange(0, len(uidlist), batch_size):
self.__processmessagesflags_real(operation,
uidlist[i:i + batch_size], flags)
return