Skip to content

Commit 91ab36b

Browse files
committed
Optimization - save decoder to local var for reuse.
1 parent 300f666 commit 91ab36b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Parse/PFObject.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1634,8 +1634,9 @@ + (instancetype)objectWithClassName:(NSString *)className {
16341634

16351635
+ (instancetype)objectWithClassName:(NSString *)className dictionary:(NSDictionary *)dictionary {
16361636
PFObject *object = [self objectWithClassName:className];
1637+
PFDecoder *objectDecoder = [PFDecoder objectDecoder];
16371638
[dictionary enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
1638-
object[key] = [[PFDecoder objectDecoder] decodeObject:obj];
1639+
object[key] = [objectDecoder decodeObject:obj];
16391640
}];
16401641
return object;
16411642
}

0 commit comments

Comments
 (0)