kylef-archive / KFData

Core Data done right for iOS 5+/OS X 10.7+
http://cocoadocs.org/docsets/KFData/
BSD 2-Clause "Simplified" License
53 stars 7 forks source link

findFirstWithPredicate should set a limit on the fetch request #21

Closed kylef closed 11 years ago

kylef commented 11 years ago

We should set a limit of 1 if we're only getting one entity (performance++)

calvincestari commented 11 years ago

This already happens in the called method executeFetchRequestAndReturnFirstObject:inManagedObjectContext:. Having that call executeFetchRequestAndEnsureSingleObject:inManagedObjectContext is a bit redundant since the fetch limit is set to 1 beforehand but it is better than duplication.

kylef commented 11 years ago

Ahh, never noticed it was already set to 1. Thanks