ObjFW  Diff

Differences From Artifact [95d0045e21]:

To Artifact [a8ef885aa6]:


63
64
65
66
67
68
69

70
71



72
73
74
75
76
77
78
79
80
81
82

83
84
85



86
87
88
89
90
91
92
- (void)insertObject: (id)object
	     atIndex: (size_t)index
{
	if (object == nil)
		@throw [OFInvalidArgumentException
		    exceptionWithClass: [self class]];


	[_array insertItem: &object
		   atIndex: index];



	[object retain];

	_mutations++;
}

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


	[_array insertItems: objects
		    atIndex: index
		      count: count];




	for (i = 0; i < count; i++)
		[objects[i] retain];

	_mutations++;
}








>
|
|
>
>
>











>
|
|
|
>
>
>







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
- (void)insertObject: (id)object
	     atIndex: (size_t)index
{
	if (object == nil)
		@throw [OFInvalidArgumentException
		    exceptionWithClass: [self class]];

	@try {
		[_array insertItem: &object
			   atIndex: index];
	} @catch (OFOutOfRangeException *e) {
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];
	}
	[object retain];

	_mutations++;
}

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

	@try {
		[_array insertItems: objects
			    atIndex: index
			      count: count];
	} @catch (OFOutOfRangeException *e) {
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];
	}

	for (i = 0; i < count; i++)
		[objects[i] retain];

	_mutations++;
}