From b3d6973fb15d0b7138b4f7ad8483b3f152ef1280 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 26 Aug 2015 09:31:08 -0400 Subject: [PATCH] (fix) small optimization --- SoObjects/SOGo/NSArray+Utilities.h | 4 +--- SoObjects/SOGo/NSArray+Utilities.m | 4 +--- UI/MailerUI/UIxMailListActions.m | 16 ++++++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/SoObjects/SOGo/NSArray+Utilities.h b/SoObjects/SOGo/NSArray+Utilities.h index d5ee37c8f..43986bf9e 100644 --- a/SoObjects/SOGo/NSArray+Utilities.h +++ b/SoObjects/SOGo/NSArray+Utilities.h @@ -1,8 +1,6 @@ /* NSArray+Utilities.h - this file is part of SOGo * - * Copyright (C) 2006 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2006-2015 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/SoObjects/SOGo/NSArray+Utilities.m b/SoObjects/SOGo/NSArray+Utilities.m index 6f2a56449..e82e3cf28 100644 --- a/SoObjects/SOGo/NSArray+Utilities.m +++ b/SoObjects/SOGo/NSArray+Utilities.m @@ -1,8 +1,6 @@ /* NSArray+Utilities.m - this file is part of SOGo * - * Copyright (C) 2006-2011 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2006-2015 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/UI/MailerUI/UIxMailListActions.m b/UI/MailerUI/UIxMailListActions.m index 4427b008d..edce6e03b 100644 --- a/UI/MailerUI/UIxMailListActions.m +++ b/UI/MailerUI/UIxMailListActions.m @@ -623,11 +623,12 @@ - (NSDictionary *) getUIDsInFolder: (SOGoMailFolder *) folder withHeaders: (BOOL) includeHeaders { - NSMutableDictionary *data; NSArray *uids, *threadedUids, *headers; - NSRange r; + NSMutableDictionary *data; SOGoMailAccount *account; id quota; + + NSRange r; int count; data = [NSMutableDictionary dictionary]; @@ -645,10 +646,14 @@ if (includeHeaders) { // Also retrieve the first headers, up to 'headersPrefetchMaxSize' - count = [[uids flattenedArray] count]; - if (count > headersPrefetchMaxSize) count = headersPrefetchMaxSize; + NSArray *a; + + a = [uids flattenedArray]; + count = [a count]; + if (count > headersPrefetchMaxSize) + count = headersPrefetchMaxSize; r = NSMakeRange(0, count); - headers = [self getHeadersForUIDs: [[uids flattenedArray] subarrayWithRange: r] + headers = [self getHeadersForUIDs: [a subarrayWithRange: r] inFolder: folder]; [data setObject: headers forKey: @"headers"]; @@ -745,7 +750,6 @@ noHeaders = [[[requestContent objectForKey: @"sortingAttributes"] objectForKey:@"noHeaders"] boolValue]; data = [self getUIDsInFolder: folder withHeaders: !noHeaders]; - [response appendContentString: [data jsonRepresentation]]; return response;