62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
+ dictionaryWithKeysAndObjects: (id <OFCopying>)firstKey, ...
{
id ret;
va_list arguments;
va_start(arguments, firstKey);
ret = [[[self alloc] initWithKey: firstKey
argumentList: arguments] autorelease];
va_end(arguments);
return ret;
}
- init
{
|
|
|
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
+ dictionaryWithKeysAndObjects: (id <OFCopying>)firstKey, ...
{
id ret;
va_list arguments;
va_start(arguments, firstKey);
ret = [[[self alloc] initWithKey: firstKey
arguments: arguments] autorelease];
va_end(arguments);
return ret;
}
- init
{
|
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
|
- initWithKeysAndObjects: (id <OFCopying>)firstKey, ...
{
id ret;
va_list arguments;
va_start(arguments, firstKey);
ret = [self initWithKey: firstKey
argumentList: arguments];
va_end(arguments);
return ret;
}
- initWithKey: (id <OFCopying>)key
argumentList: (va_list)arguments
{
self = [super init];
@try {
id object;
uint32_t i, j, hash, newSize;
va_list argumentsCopy;
struct of_dictionary_bucket *bucket;
va_copy(argumentsCopy, arguments);
if (key == nil)
@throw [OFInvalidArgumentException newWithClass: isa
selector: _cmd];
if ((object = va_arg(arguments, id)) == nil)
@throw [OFInvalidArgumentException newWithClass: isa
selector: _cmd];
count = 1;
for (; va_arg(argumentsCopy, id) != nil; count++);
|
|
|
|
|
|
>
>
|
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
|
- initWithKeysAndObjects: (id <OFCopying>)firstKey, ...
{
id ret;
va_list arguments;
va_start(arguments, firstKey);
ret = [self initWithKey: firstKey
arguments: arguments];
va_end(arguments);
return ret;
}
- initWithKey: (id <OFCopying>)firstKey
arguments: (va_list)arguments
{
self = [super init];
@try {
id key, object;
uint32_t i, j, hash, newSize;
va_list argumentsCopy;
struct of_dictionary_bucket *bucket;
va_copy(argumentsCopy, arguments);
if (firstKey == nil)
@throw [OFInvalidArgumentException newWithClass: isa
selector: _cmd];
key = firstKey;
if ((object = va_arg(arguments, id)) == nil)
@throw [OFInvalidArgumentException newWithClass: isa
selector: _cmd];
count = 1;
for (; va_arg(argumentsCopy, id) != nil; count++);
|