Skip to content

Commit 4ce8645

Browse files
committed
Wanton microoptimization for -[_SwiftNativeNSError classForCoder]
We have a static cache var for [NSError class], so save an objc_msgSend here
1 parent fee9c2a commit 4ce8645

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/runtime/ErrorObject.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ - (id)copyWithZone:(NSZone *)zone {
9898
- (Class)classForCoder {
9999
// This is a runtime-private subclass. When archiving or unarchiving, do so
100100
// as an NSError.
101-
return [NSError class];
101+
return getNSErrorClass();
102102
}
103103

104104
@end

0 commit comments

Comments
 (0)