Differences From Artifact [a4ce122b88]:
- File src/OFDictionary_hashtable.m — part of check-in [ce70e17b38] at 2012-01-05 00:56:18 on branch trunk — Update copyright. (user: js, size: 17564) [annotate] [blame] [check-ins using]
To Artifact [dc60bfa33c]:
- File
src/OFDictionary_hashtable.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: 17572) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
237 238 239 240 241 242 243 | { self = [super init]; @try { id *objectsCArray, *keysCArray; uint32_t i, j, newSize; | | | | 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | { self = [super init]; @try { id *objectsCArray, *keysCArray; uint32_t i, j, newSize; keysCArray = [keys objects]; objectsCArray = [objects objects]; count = [keys count]; if (count > UINT32_MAX) @throw [OFOutOfRangeException exceptionWithClass: isa]; for (newSize = 1; newSize < count; newSize <<= 1); if (count * 4 / newSize >= 3) |
︙ | ︙ | |||
626 627 628 629 630 631 632 | return NO; } - (OFArray*)allKeys { OFArray *ret; | | | | | | | | | | | | | | 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 | return NO; } - (OFArray*)allKeys { OFArray *ret; id *keys = [self allocMemoryForNItems: count ofSize: sizeof(id)]; size_t i, j; for (i = j = 0; i < size; i++) if (data[i] != NULL && data[i] != DELETED) keys[j++] = data[i]->key; assert(j == count); @try { ret = [OFArray arrayWithObjects: keys count: count]; } @finally { [self freeMemory: keys]; } return ret; } - (OFArray*)allObjects { OFArray *ret; id *objects = [self allocMemoryForNItems: count ofSize: sizeof(id)]; size_t i, j; for (i = j = 0; i < size; i++) if (data[i] != NULL && data[i] != DELETED) objects[j++] = data[i]->object; assert(j == count); @try { ret = [OFArray arrayWithObjects: objects count: count]; } @finally { [self freeMemory: objects]; } return ret; } - (OFEnumerator*)keyEnumerator { |
︙ | ︙ |