ObjFW  Diff

Differences From Artifact [cdb0c9cc7a]:

To Artifact [7116965323]:


48
49
50
51
52
53
54




55
56
57
58
59
60
61
}

- initWithObject: (id)object
{
	self = [self init];

	@try {




		[array addItem: &object];
		[object retain];
	} @catch (id e) {
		[self release];
		@throw e;
	}








>
>
>
>







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
}

- initWithObject: (id)object
{
	self = [self init];

	@try {
		if (object == nil)
			@throw [OFInvalidArgumentException
			    exceptionWithClass: [self class]];

		[array addItem: &object];
		[object retain];
	} @catch (id e) {
		[self release];
		@throw e;
	}

88
89
90
91
92
93
94



95
96
97
98
99
100
101
- initWithArray: (OFArray*)array_
{
	id *objects;
	size_t i, count;

	self = [self init];




	@try {
		objects = [array_ objects];
		count = [array_ count];
	} @catch (id e) {
		[self release];
		@throw e;
	}







>
>
>







92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
- initWithArray: (OFArray*)array_
{
	id *objects;
	size_t i, count;

	self = [self init];

	if (array_ == nil)
		return self;

	@try {
		objects = [array_ objects];
		count = [array_ count];
	} @catch (id e) {
		[self release];
		@throw e;
	}
124
125
126
127
128
129
130

131
132



133





134
135
136
137
138
139
140
- initWithObjects: (id const*)objects
	    count: (size_t)count
{
	self = [self init];

	@try {
		size_t i;


		for (i = 0; i < count; i++)



			[objects[i] retain];






		[array addItemsFromCArray: objects
				    count: count];
	} @catch (id e) {
		size_t i;

		for (i = 0; i < count; i++)







>

|
>
>
>

>
>
>
>
>







131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
- initWithObjects: (id const*)objects
	    count: (size_t)count
{
	self = [self init];

	@try {
		size_t i;
		BOOL ok = YES;

		for (i = 0; i < count; i++) {
			if (objects[i] == nil)
				ok = NO;

			[objects[i] retain];
		}

		if (!ok)
			@throw [OFInvalidArgumentException
			    exceptionWithClass: [self class]];

		[array addItemsFromCArray: objects
				    count: count];
	} @catch (id e) {
		size_t i;

		for (i = 0; i < count; i++)
218
219
220
221
222
223
224






225
226
227
228
229
230
231
232
233
234
235
236






237
238
239
240
241
242
243
244
245

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

- (size_t)indexOfObject: (id)object
{






	id *objects = [array cArray];
	size_t i, count = [array count];

	for (i = 0; i < count; i++)
		if ([objects[i] isEqual: object])
			return i;

	return OF_NOT_FOUND;
}

- (size_t)indexOfObjectIdenticalTo: (id)object
{






	id *objects = [array cArray];
	size_t i, count = [array count];

	for (i = 0; i < count; i++)
		if (objects[i] == object)
			return i;

	return OF_NOT_FOUND;
}







>
>
>
>
>
>
|
|










>
>
>
>
>
>
|
|







234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273

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

- (size_t)indexOfObject: (id)object
{
	id *objects;
	size_t i, count;

	if (object == nil)
		return OF_NOT_FOUND;

	objects = [array cArray];
	count = [array count];

	for (i = 0; i < count; i++)
		if ([objects[i] isEqual: object])
			return i;

	return OF_NOT_FOUND;
}

- (size_t)indexOfObjectIdenticalTo: (id)object
{
	id *objects;
	size_t i, count;

	if (object == nil)
		return OF_NOT_FOUND;

	objects = [array cArray];
	count = [array count];

	for (i = 0; i < count; i++)
		if (objects[i] == object)
			return i;

	return OF_NOT_FOUND;
}