diff options
Diffstat (limited to 'objectivec/GPBDictionary.m')
-rw-r--r-- | objectivec/GPBDictionary.m | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/objectivec/GPBDictionary.m b/objectivec/GPBDictionary.m index fd8bd1ce..1c67c680 100644 --- a/objectivec/GPBDictionary.m +++ b/objectivec/GPBDictionary.m @@ -13579,22 +13579,26 @@ void GPBDictionaryReadEntry(id mapDictionary, - (id)copyWithZone:(NSZone *)zone { if (_dictionary == nil) { - _dictionary = [[NSMutableDictionary alloc] init]; + return [[NSMutableDictionary allocWithZone:zone] init]; } return [_dictionary copyWithZone:zone]; } - (id)mutableCopyWithZone:(NSZone *)zone { if (_dictionary == nil) { - _dictionary = [[NSMutableDictionary alloc] init]; + return [[NSMutableDictionary allocWithZone:zone] init]; } return [_dictionary mutableCopyWithZone:zone]; } +// Not really needed, but subscripting is likely common enough it doesn't hurt +// to ensure it goes directly to the real NSMutableDictionary. - (id)objectForKeyedSubscript:(id)key { return [_dictionary objectForKeyedSubscript:key]; } +// Not really needed, but subscripting is likely common enough it doesn't hurt +// to ensure it goes directly to the real NSMutableDictionary. - (void)setObject:(id)obj forKeyedSubscript:(id<NSCopying>)key { if (_dictionary == nil) { _dictionary = [[NSMutableDictionary alloc] init]; |