Differences From Artifact [95d0045e21]:
- File src/OFMutableArray_adjacent.m — part of check-in [e0c9168dfc] at 2013-02-18 12:27:09 on branch trunk — Add -[OFMutableArray initWithCapacity:]. (user: js, size: 7589) [annotate] [blame] [check-ins using]
To Artifact [a8ef885aa6]:
- File
src/OFMutableArray_adjacent.m
— part of check-in
[2de15db195]
at
2013-03-01 21:19:02
on branch trunk
— Rethrow some exceptions to fix class.
This way, the error message will show the called class instead of the
class used internally. (user: js, size: 7828) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
63 64 65 66 67 68 69 |
- (void)insertObject: (id)object
atIndex: (size_t)index
{
if (object == nil)
@throw [OFInvalidArgumentException
exceptionWithClass: [self class]];
| > | | > > > > | | | > > > | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
- (void)insertObject: (id)object
atIndex: (size_t)index
{
if (object == nil)
@throw [OFInvalidArgumentException
exceptionWithClass: [self class]];
@try {
[_array insertItem: &object
atIndex: index];
} @catch (OFOutOfRangeException *e) {
@throw [OFOutOfRangeException exceptionWithClass: [self class]];
}
[object retain];
_mutations++;
}
- (void)insertObjectsFromArray: (OFArray*)array
atIndex: (size_t)index
{
id *objects = [array objects];
size_t i, count = [array count];
@try {
[_array insertItems: objects
atIndex: index
count: count];
} @catch (OFOutOfRangeException *e) {
@throw [OFOutOfRangeException exceptionWithClass: [self class]];
}
for (i = 0; i < count; i++)
[objects[i] retain];
_mutations++;
}
|
| ︙ | ︙ |