From 38e886a3e0c6c8986fef4a7b170f0c225e4ef5df Mon Sep 17 00:00:00 2001 From: smizrahi Date: Wed, 16 Nov 2022 21:59:11 +0100 Subject: [PATCH] perf(mail): Improve IMAP fetch sorting using NSDictionary keys instead of indexOfObject. Fix build issue. --- SoObjects/Mailer/SOGoMailFolder.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index 34a332d8a..3f318a80f 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -2364,7 +2364,7 @@ static NSInteger _compareFetchResultsByUIDDict (id entry1, id entry2, NSDictiona NSArray *a, *uids; NSDictionary *d; id fetchResults, sortedResults; - NSUInteger i; + NSUInteger index; NSMutableDictionary *uidsDict; int i; @@ -2434,8 +2434,8 @@ static NSInteger _compareFetchResultsByUIDDict (id entry1, id entry2, NSDictiona else { uidsDict = [[NSMutableDictionary alloc] init]; - for (i = 0 ; i < [uids length] ; i++) { - [uidsDict setObject:[NSNumber numberWithInt: i] forKey: [NSString stringWithFormat:@"%d", [[uids objectAtIndex: i] intValue]]]; + for (index = 0 ; index < [uids length] ; index++) { + [uidsDict setObject:[NSNumber numberWithInt: index] forKey: [NSString stringWithFormat:@"%d", [[uids objectAtIndex: index] intValue]]]; } sortedResults = [fetchResults sortedArrayUsingFunction: _compareFetchResultsByUIDDict context: uidsDict];