Skip to content

Commit

Permalink
Merge pull request #38 from dcramps/master
Browse files Browse the repository at this point in the history
Fix incorrect inner loop when batching createOrUpdateInRealm:withJSONDictionary: calls
  • Loading branch information
matthewcheok committed Apr 12, 2015
2 parents 26a42aa + 4ce3a9a commit 15c73da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Realm+JSON/RLMObject+JSON.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ + (NSArray *)createOrUpdateInRealm:(RLMRealm *)realm withJSONArray:(NSArray *)ar
for (NSInteger index=0; index*kCreateBatchSize<count; index++) {
NSInteger size = MIN(kCreateBatchSize, count-index*kCreateBatchSize);
@autoreleasepool {
for (NSInteger subIndex=index*kCreateBatchSize; subIndex<size; subIndex++) {
NSDictionary *dictionary = array[subIndex];
for (NSInteger subIndex=0; subIndex<size; subIndex++) {
NSDictionary *dictionary = array[index*kCreateBatchSize+subIndex];
id object = [self createOrUpdateInRealm:realm withJSONDictionary:dictionary];
[result addObject:object];
}
Expand Down

0 comments on commit 15c73da

Please sign in to comment.