ObjFW  Diff

Differences From Artifact [7f0d5a8891]:

To Artifact [bf06454e8f]:


143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177

	return self;
}

- initWithObjects: (OFArray*)objs
	  forKeys: (OFArray*)keys
{
	id *objs_data, *keys_data;
	size_t objs_count, i;
	const SEL sel = @selector(setObject:forKey:);
	IMP set = [OFMutableDictionary instanceMethodForSelector: sel];

	self = [self init];

	objs_data = [objs data];
	keys_data = [keys data];
	objs_count = [objs count];

	if (objs == nil || keys == nil || objs_count != [keys count]) {
		Class c = isa;
		[self dealloc];
		@throw [OFInvalidArgumentException newWithClass: c
						       selector: _cmd];
	}

	@try {
		for (i = 0; i < objs_count; i++)
			set(self, sel, objs_data[i], keys_data[i]);
	} @catch (OFException *e) {
		[self dealloc];
		@throw e;
	}

	return self;
}







|






|
|











|







143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177

	return self;
}

- initWithObjects: (OFArray*)objs
	  forKeys: (OFArray*)keys
{
	id *objs_carray, *keys_carray;
	size_t objs_count, i;
	const SEL sel = @selector(setObject:forKey:);
	IMP set = [OFMutableDictionary instanceMethodForSelector: sel];

	self = [self init];

	objs_carray = [objs cArray];
	keys_carray = [keys cArray];
	objs_count = [objs count];

	if (objs == nil || keys == nil || objs_count != [keys count]) {
		Class c = isa;
		[self dealloc];
		@throw [OFInvalidArgumentException newWithClass: c
						       selector: _cmd];
	}

	@try {
		for (i = 0; i < objs_count; i++)
			set(self, sel, objs_carray[i], keys_carray[i]);
	} @catch (OFException *e) {
		[self dealloc];
		@throw e;
	}

	return self;
}