Differences From Artifact [9a08c57256]:
- File
src/OFMapTable.m
— part of check-in
[6b77a5dd8b]
at
2017-05-21 21:28:57
on branch trunk
— Prefix private methods with of_ instead of OF_
This matches Apple's style. (user: js, size: 16841) [annotate] [blame] [check-ins using]
To Artifact [73724a7b07]:
- File src/OFMapTable.m — part of check-in [2de9660312] at 2017-09-28 23:02:23 on branch trunk — Enable -Wnullable-to-nonnull-conversion and adjust (user: js, size: 16914) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
685 686 687 688 689 690 691 | - (void)dealloc { [_mapTable release]; [super dealloc]; } | | | | | | | 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 | - (void)dealloc { [_mapTable release]; [super dealloc]; } - (void **)nextObject { OF_UNRECOGNIZED_SELECTOR } - (void)reset { if (*_mutationsPtr != _mutations) @throw [OFEnumerationMutationException exceptionWithObject: _mapTable]; _position = 0; } @end @implementation OFMapTableKeyEnumerator - (void **)nextObject { if (*_mutationsPtr != _mutations) @throw [OFEnumerationMutationException exceptionWithObject: _mapTable]; for (; _position < _capacity && (_buckets[_position] == NULL || _buckets[_position] == &deleted); _position++); if (_position < _capacity) return &_buckets[_position++]->key; else return NULL; } @end @implementation OFMapTableObjectEnumerator - (void **)nextObject { if (*_mutationsPtr != _mutations) @throw [OFEnumerationMutationException exceptionWithObject: _mapTable]; for (; _position < _capacity && (_buckets[_position] == NULL || _buckets[_position] == &deleted); _position++); if (_position < _capacity) return &_buckets[_position++]->object; else return NULL; } @end @implementation OFMapTable_EnumeratorWrapper - initWithEnumerator: (OFMapTableEnumerator *)enumerator |
︙ | ︙ | |||
756 757 758 759 760 761 762 | [_object release]; [super dealloc]; } - (id)nextObject { | | | > > > | | 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 | [_object release]; [super dealloc]; } - (id)nextObject { void **objectPtr; @try { objectPtr = [_enumerator nextObject]; if (objectPtr == NULL) return nil; } @catch (OFEnumerationMutationException *e) { @throw [OFEnumerationMutationException exceptionWithObject: _object]; } return (id)*objectPtr; } - (void)reset { @try { [_enumerator reset]; } @catch (OFEnumerationMutationException *e) { @throw [OFEnumerationMutationException exceptionWithObject: _object]; } } @end |