Differences From Artifact [940c27c632]:
- File src/OFDictionary.m — part of check-in [ce70e17b38] at 2012-01-05 00:56:18 on branch trunk — Update copyright. (user: js, size: 11885) [annotate] [blame] [check-ins using]
To Artifact [29eff2abae]:
- File
src/OFDictionary.m
— part of check-in
[008be86a16]
at
2012-03-12 11:54:22
on branch trunk
— OFArray: +[arrayWithCArray:length:] -> +[arrayWithObjects:count:].
This is required for the new array literals. (user: js, size: 11891) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
309 310 311 312 313 314 315 | return NO; } - (OFArray*)allKeys { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; | | | | | | | | | | | | | | 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 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | return NO; } - (OFArray*)allKeys { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; id *keys = [self allocMemoryForNItems: [self count] ofSize: sizeof(id)]; OFArray *ret; OFEnumerator *enumerator; id key; size_t i = 0; pool = [[OFAutoreleasePool alloc] init]; enumerator = [self keyEnumerator]; while ((key = [enumerator nextObject]) != nil) keys[i++] = key; assert(i == [self count]); [pool release]; @try { ret = [OFArray arrayWithObjects: keys count: [self count]]; } @finally { [self freeMemory: keys]; } return ret; } - (OFArray*)allObjects { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; id *objects = [self allocMemoryForNItems: [self count] ofSize: sizeof(id)]; OFArray *ret; OFEnumerator *enumerator; id object; size_t i = 0; pool = [[OFAutoreleasePool alloc] init]; enumerator = [self objectEnumerator]; while ((object = [enumerator nextObject]) != nil) objects[i++] = object; assert(i == [self count]); [pool release]; @try { ret = [OFArray arrayWithObjects: objects count: [self count]]; } @finally { [self freeMemory: objects]; } return ret; } - (OFEnumerator*)objectEnumerator { |
︙ | ︙ |