Differences From Artifact [55b87bb47c]:
- File
src/OFMutableArray_adjacent.m
— part of check-in
[7fec2ef57e]
at
2017-05-01 13:37:26
on branch trunk
— Add tests for generic OFArray / OFMutableArray
These are usually not used, as OFArray_adjacent and
OFMutableArray_adjacent are used instead. However, they are used if
someone creates their own subclass of OFArray / OFMutableArray. As they
are rarely used in production, it is important to run all tests on them. (user: js, size: 7694) [annotate] [blame] [check-ins using]
To Artifact [6496c63550]:
- File
src/OFMutableArray_adjacent.m
— part of check-in
[4af49a13c3]
at
2017-05-07 20:10:13
on branch trunk
— Small code style change
Casts are now written like types in variable declarations. (user: js, size: 7698) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
72 73 74 75 76 77 78 | @throw [OFOutOfRangeException exception]; } [object retain]; _mutations++; } | | | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
@throw [OFOutOfRangeException exception];
}
[object retain];
_mutations++;
}
- (void)insertObjectsFromArray: (OFArray *)array
atIndex: (size_t)index
{
id const *objects = [array objects];
size_t count = [array count];
@try {
[_array insertItems: objects
|
| ︙ | ︙ | |||
294 295 296 297 298 299 300 |
for (i = 0, j = count - 1; i < j; i++, j--) {
id tmp = objects[i];
objects[i] = objects[j];
objects[j] = tmp;
}
}
| | | | 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
for (i = 0, j = count - 1; i < j; i++, j--) {
id tmp = objects[i];
objects[i] = objects[j];
objects[j] = tmp;
}
}
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state
objects: (id *)objects
count: (int)count_
{
size_t count = [_array count];
if (count > INT_MAX) {
/*
* Use the implementation from OFArray (OFMutableArray does not
|
| ︙ | ︙ | |||
323 324 325 326 327 328 329 | state->state = (unsigned long)count; state->itemsPtr = [_array items]; state->mutationsPtr = &_mutations; return (int)count; } | | | 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
state->state = (unsigned long)count;
state->itemsPtr = [_array items];
state->mutationsPtr = &_mutations;
return (int)count;
}
- (OFEnumerator *)objectEnumerator
{
return [[[OFArrayEnumerator alloc]
initWithArray: self
mutationsPtr: &_mutations] autorelease];
}
#ifdef OF_HAVE_BLOCKS
|
| ︙ | ︙ |