adium 5085:9178c6fa3e1e: Improve the speed of fast enumeration b...

commits at adium.im commits at adium.im
Tue Sep 18 10:39:54 UTC 2012


details:	http://hg.adium.im/adium/rev/9178c6fa3e1e
revision:	5085:9178c6fa3e1e
branch:		adium-1.5.4
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Tue Sep 18 12:38:50 2012 +0200

Improve the speed of fast enumeration by not using the property, as it -copies these ivars.

This also fixes a crash with ARC.

diffs (36 lines):

diff -r f27be96d5839 -r 9178c6fa3e1e Frameworks/Adium Framework/Source/AIChat.m
--- a/Frameworks/Adium Framework/Source/AIChat.m	Sat Sep 15 17:32:10 2012 -0400
+++ b/Frameworks/Adium Framework/Source/AIChat.m	Tue Sep 18 12:38:50 2012 +0200
@@ -1069,7 +1069,7 @@
 
 - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len
 {
-	return [self.containedObjects countByEnumeratingWithState:state objects:stackbuf count:len];
+	return [participatingContacts countByEnumeratingWithState:state objects:stackbuf count:len];
 }
 
 - (BOOL) canContainObject:(id)obj
diff -r f27be96d5839 -r 9178c6fa3e1e Frameworks/Adium Framework/Source/AIListGroup.m
--- a/Frameworks/Adium Framework/Source/AIListGroup.m	Sat Sep 15 17:32:10 2012 -0400
+++ b/Frameworks/Adium Framework/Source/AIListGroup.m	Tue Sep 18 12:38:50 2012 +0200
@@ -360,7 +360,7 @@
 
 - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len
 {
-	return [self.containedObjects countByEnumeratingWithState:state objects:stackbuf count:len];
+	return [_containedObjects countByEnumeratingWithState:state objects:stackbuf count:len];
 }
 
 #pragma mark Applescript
diff -r f27be96d5839 -r 9178c6fa3e1e Frameworks/Adium Framework/Source/AIMetaContact.m
--- a/Frameworks/Adium Framework/Source/AIMetaContact.m	Sat Sep 15 17:32:10 2012 -0400
+++ b/Frameworks/Adium Framework/Source/AIMetaContact.m	Tue Sep 18 12:38:50 2012 +0200
@@ -1038,7 +1038,7 @@
 
 - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len
 {
-	return [self.containedObjects countByEnumeratingWithState:state objects:stackbuf count:len];
+	return [_containedObjects countByEnumeratingWithState:state objects:stackbuf count:len];
 }
 
 #pragma mark Contained Contact sorting




More information about the commits mailing list