Differences From Artifact [7d4c6241d2]:
- File
src/OFMapTableDictionary.m
— part of check-in
[6ce0093f8d]
at
2023-04-10 19:22:32
on branch trunk
— Remove OFSerialization
While the idea sounds nice that the tag name is the class, this means the
serialization includes whether something is mutable or immutable. This means
doing as much as making something immutable changes the serialization, which
can then cause issues after being deserialized. (user: js, size: 7435) [annotate] [blame] [check-ins using] [more...]
To Artifact [8171774da2]:
- File src/OFConcreteDictionary.m — part of check-in [281b494de4] at 2023-08-09 10:09:08 on branch trunk — More consistency in naming of private classes (user: js, size: 7435) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
11 12 13 14 15 16 17 | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" | | > < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #import "OFConcreteDictionary.h" #import "OFArray.h" #import "OFConcreteMutableDictionary.h" #import "OFMapTable+Private.h" #import "OFMapTable.h" #import "OFString.h" #import "OFEnumerationMutationException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" static void * |
︙ | ︙ | |||
65 66 67 68 69 70 71 | static const OFMapTableFunctions objectFunctions = { .retain = retain, .release = release, .hash = hash, .equal = equal }; | | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | static const OFMapTableFunctions objectFunctions = { .retain = retain, .release = release, .hash = hash, .equal = equal }; @implementation OFConcreteDictionary - (instancetype)init { return [self initWithCapacity: 0]; } - (instancetype)initWithCapacity: (size_t)capacity { |
︙ | ︙ | |||
95 96 97 98 99 100 101 | - (instancetype)initWithDictionary: (OFDictionary *)dictionary { size_t count; if (dictionary == nil) return [self init]; | | | | | | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | - (instancetype)initWithDictionary: (OFDictionary *)dictionary { size_t count; if (dictionary == nil) return [self init]; if ([dictionary isKindOfClass: [OFConcreteDictionary class]] || [dictionary isKindOfClass: [OFConcreteMutableDictionary class]]) { self = [super init]; @try { OFConcreteDictionary *dictionary_ = (OFConcreteDictionary *)dictionary; _mapTable = [dictionary_->_mapTable copy]; } @catch (id e) { [self release]; @throw e; } |
︙ | ︙ | |||
244 245 246 247 248 249 250 | - (size_t)count { return _mapTable.count; } - (bool)isEqual: (id)object { | | | | | | 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | - (size_t)count { return _mapTable.count; } - (bool)isEqual: (id)object { OFConcreteDictionary *dictionary; if (object == self) return true; if (![object isKindOfClass: [OFConcreteDictionary class]] && ![object isKindOfClass: [OFConcreteMutableDictionary class]]) return [super isEqual: object]; dictionary = (OFConcreteDictionary *)object; return [dictionary->_mapTable isEqual: _mapTable]; } - (bool)containsObject: (id)object { return [_mapTable containsObject: object]; |
︙ | ︙ |