ObjFW  Diff

Differences From Artifact [7c4a615aae]:

To Artifact [a6c8e71afe]:


158
159
160
161
162
163
164
165
166
167
168
169
170
171
172

		pool = [[OFAutoreleasePool alloc] init];

		if ((![[element name] isEqual: @"OFArray"] &&
		    ![[element name] isEqual: @"OFMutableArray"]) ||
		    ![[element namespace] isEqual: OF_SERIALIZATION_NS])
			@throw [OFInvalidArgumentException
			    exceptionWithClass: isa
				      selector: _cmd];

		enumerator = [[element elementsForNamespace:
		    OF_SERIALIZATION_NS] objectEnumerator];
		pool2 = [[OFAutoreleasePool alloc] init];

		while ((child = [enumerator nextObject]) != nil) {







|







158
159
160
161
162
163
164
165
166
167
168
169
170
171
172

		pool = [[OFAutoreleasePool alloc] init];

		if ((![[element name] isEqual: @"OFArray"] &&
		    ![[element name] isEqual: @"OFMutableArray"]) ||
		    ![[element namespace] isEqual: OF_SERIALIZATION_NS])
			@throw [OFInvalidArgumentException
			    exceptionWithClass: [self class]
				      selector: _cmd];

		enumerator = [[element elementsForNamespace:
		    OF_SERIALIZATION_NS] objectEnumerator];
		pool2 = [[OFAutoreleasePool alloc] init];

		while ((child = [enumerator nextObject]) != nil) {
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
- (void)getObjects: (id*)buffer
	   inRange: (of_range_t)range
{
	id *objects = [array cArray];
	size_t i, count = [array count];

	if (range.start + range.length > count)
		@throw [OFOutOfRangeException exceptionWithClass: isa];

	for (i = 0; i < range.length; i++)
		buffer[i] = objects[range.start + i];
}

- (size_t)indexOfObject: (id)object
{







|







209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
- (void)getObjects: (id*)buffer
	   inRange: (of_range_t)range
{
	id *objects = [array cArray];
	size_t i, count = [array count];

	if (range.start + range.length > count)
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];

	for (i = 0; i < range.length; i++)
		buffer[i] = objects[range.start + i];
}

- (size_t)indexOfObject: (id)object
{
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
	if (![self isKindOfClass: [OFMutableArray class]])
		return [OFArray_adjacentSubarray arrayWithArray: self
							  range: range];

	count = [array count];

	if (range.start + range.length > count)
		@throw [OFOutOfRangeException exceptionWithClass: isa];

	return [OFArray arrayWithObjects: (id*)[array cArray] + range.start
				   count: range.length];
}

- (BOOL)isEqual: (id)object
{







|







251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
	if (![self isKindOfClass: [OFMutableArray class]])
		return [OFArray_adjacentSubarray arrayWithArray: self
							  range: range];

	count = [array count];

	if (range.start + range.length > count)
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];

	return [OFArray arrayWithObjects: (id*)[array cArray] + range.start
				   count: range.length];
}

- (BOOL)isEqual: (id)object
{