PageRenderTime 26ms CodeModel.GetById 15ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 10ms

/Frameworks/OJMoq/CPArray+Find.j

http://github.com/hammerdr/OJTest
Unknown | 16 lines | 13 code | 3 blank | 0 comment | 0 complexity | a83a9e6fc0e53715a3b3b80b4eb0d0e4 MD5 | raw file
 1@implementation CPArray (Find)
 2
 3- (CPObject)findBy:(Function)isTheObject
 4{
 5	for(var i = 0; i < [self count]; i++)
 6	{
 7		if(isTheObject([self objectAtIndex:i]))
 8		{
 9			return [self objectAtIndex:i];
10		}
11	}
12	
13	return nil;
14}
15
16@end