Differences From Artifact [833d3b17ca]:
- File src/OFMutableArray.m — part of check-in [89d53f2a9a] at 2012-03-29 07:57:34 on branch trunk — Add a few "const" where they make sense. (user: js, size: 6525) [annotate] [blame] [check-ins using] [more...]
To Artifact [aaf401cec7]:
- File
src/OFMutableArray.m
— part of check-in
[13e6e99067]
at
2012-06-06 12:15:40
on branch trunk
— swapObjectAtIndex... -> exchangeObjectAtIndex...
For consistency with Foundation. (user: js, size: 6536) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
55 56 57 58 59 60 61 | i++; while ([[array objectAtIndex: j] compare: pivot] != OF_ORDERED_ASCENDING && j > left) j--; if (i < j) | | | | | | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | i++; while ([[array objectAtIndex: j] compare: pivot] != OF_ORDERED_ASCENDING && j > left) j--; if (i < j) [array exchangeObjectAtIndex: i withObjectAtIndex: j]; } while (i < j); if ([[array objectAtIndex: i] compare: pivot] == OF_ORDERED_DESCENDING) [array exchangeObjectAtIndex: i withObjectAtIndex: right]; if (i > 0) quicksort(array, left, i - 1); quicksort(array, i + 1, right); } @implementation OFMutableArray_placeholder |
︙ | ︙ | |||
295 296 297 298 299 300 301 | BOOL *stop) { [self replaceObjectAtIndex: index withObject: block(object, index, stop)]; }]; } #endif | | | | 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | BOOL *stop) { [self replaceObjectAtIndex: index withObject: block(object, index, stop)]; }]; } #endif - (void)exchangeObjectAtIndex: (size_t)index1 withObjectAtIndex: (size_t)index2 { id object1 = [self objectAtIndex: index1]; id object2 = [self objectAtIndex: index2]; [object1 retain]; @try { [self replaceObjectAtIndex: index1 |
︙ | ︙ | |||
330 331 332 333 334 335 336 | { size_t i, j, count = [self count]; if (count == 0 || count == 1) return; for (i = 0, j = count - 1; i < j; i++, j--) | | | | 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | { size_t i, j, count = [self count]; if (count == 0 || count == 1) return; for (i = 0, j = count - 1; i < j; i++, j--) [self exchangeObjectAtIndex: i withObjectAtIndex: j]; } - (void)makeImmutable { } @end |