ObjFW  Diff

Differences From Artifact [55b87bb47c]:

To Artifact [6496c63550]:


72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
		@throw [OFOutOfRangeException exception];
	}
	[object retain];

	_mutations++;
}

- (void)insertObjectsFromArray: (OFArray*)array
		       atIndex: (size_t)index
{
	id const *objects = [array objects];
	size_t count = [array count];

	@try {
		[_array insertItems: objects







|







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
		@throw [OFOutOfRangeException exception];
	}
	[object retain];

	_mutations++;
}

- (void)insertObjectsFromArray: (OFArray *)array
		       atIndex: (size_t)index
{
	id const *objects = [array objects];
	size_t count = [array count];

	@try {
		[_array insertItems: objects
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
	for (i = 0, j = count - 1; i < j; i++, j--) {
		id tmp = objects[i];
		objects[i] = objects[j];
		objects[j] = tmp;
	}
}

- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
			   objects: (id*)objects
			     count: (int)count_
{
	size_t count = [_array count];

	if (count > INT_MAX) {
		/*
		 * Use the implementation from OFArray (OFMutableArray does not







|
|







294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
	for (i = 0, j = count - 1; i < j; i++, j--) {
		id tmp = objects[i];
		objects[i] = objects[j];
		objects[j] = tmp;
	}
}

- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state
			   objects: (id *)objects
			     count: (int)count_
{
	size_t count = [_array count];

	if (count > INT_MAX) {
		/*
		 * Use the implementation from OFArray (OFMutableArray does not
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
	state->state = (unsigned long)count;
	state->itemsPtr = [_array items];
	state->mutationsPtr = &_mutations;

	return (int)count;
}

- (OFEnumerator*)objectEnumerator
{
	return [[[OFArrayEnumerator alloc]
	    initWithArray: self
	     mutationsPtr: &_mutations] autorelease];
}

#ifdef OF_HAVE_BLOCKS







|







323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
	state->state = (unsigned long)count;
	state->itemsPtr = [_array items];
	state->mutationsPtr = &_mutations;

	return (int)count;
}

- (OFEnumerator *)objectEnumerator
{
	return [[[OFArrayEnumerator alloc]
	    initWithArray: self
	     mutationsPtr: &_mutations] autorelease];
}

#ifdef OF_HAVE_BLOCKS