ObjFW  Diff

Differences From Artifact [1688e99723]:

To Artifact [fb2a261b38]:


121
122
123
124
125
126
127
128

129
130
131
132
133

134
135
136
137
138
139
140

141
142
143
144
145
146
147
121
122
123
124
125
126
127

128
129
130
131
132

133
134
135
136
137
138
139

140
141
142
143
144
145
146
147







-
+




-
+






-
+







{
	self = [self init];

	@try {
		void *pool = objc_autoreleasePoolPush();

		if (![element.name isEqual: @"OFCountedSet"] ||
		    ![element.namespace isEqual: OF_SERIALIZATION_NS])
		    ![element.namespace isEqual: OFSerializationNS])
			@throw [OFInvalidArgumentException exception];

		for (OFXMLElement *objectElement in
		    [element elementsForName: @"object"
				   namespace: OF_SERIALIZATION_NS]) {
				   namespace: OFSerializationNS]) {
			void *pool2 = objc_autoreleasePoolPush();
			OFXMLElement *object;
			OFXMLAttribute *countAttribute;
			unsigned long long count;

			object = [objectElement elementsForNamespace:
			    OF_SERIALIZATION_NS].firstObject;
			    OFSerializationNS].firstObject;
			countAttribute =
			    [objectElement attributeForName: @"count"];

			if (object == nil || countAttribute == nil)
				@throw [OFInvalidFormatException exception];

			count = countAttribute.unsignedLongLongValue;
165
166
167
168
169
170
171
172

173
174
175
176
177
178
179
180
165
166
167
168
169
170
171

172

173
174
175
176
177
178
179







-
+
-








- (size_t)countForObject: (id)object
{
	return (size_t)(uintptr_t)[_mapTable objectForKey: object];
}

#ifdef OF_HAVE_BLOCKS
- (void)enumerateObjectsAndCountUsingBlock:
- (void)enumerateObjectsAndCountUsingBlock: (OFCountedSetEnumerationBlock)block
    (of_counted_set_enumeration_block_t)block
{
	@try {
		[_mapTable enumerateKeysAndObjectsUsingBlock:
		    ^ (void *key, void *object, bool *stop) {
			block(key, (size_t)(uintptr_t)object, stop);
		}];
	} @catch (OFEnumerationMutationException *e) {