Skip to content

Commit

Permalink
Merge pull request Mantle#548 from zadr/skip-validation-on-copy
Browse files Browse the repository at this point in the history
skip re-validation in -[MTLModel copyWithZone:]
  • Loading branch information
robb committed Jul 21, 2015
2 parents 67c0a49 + 6cc31af commit 8f937de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Mantle/MTLModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,9 @@ - (BOOL)validate:(NSError **)error {
#pragma mark NSCopying

- (instancetype)copyWithZone:(NSZone *)zone {
return [[self.class allocWithZone:zone] initWithDictionary:self.dictionaryValue error:NULL];
MTLModel *copy = [[self.class allocWithZone:zone] init];
[copy setValuesForKeysWithDictionary:self.dictionaryValue];
return copy;
}

#pragma mark NSObject
Expand Down

0 comments on commit 8f937de

Please sign in to comment.