Overview
Comment: | OFArray: Remove/replace all objects |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
a593419b757bd8a7a97b5378503cdd57 |
User & Date: | js on 2022-06-07 21:50:03 |
Other Links: | manifest | tags |
Context
2022-06-08
| ||
16:20 | OFDictionary: Add some forgotten documentation check-in: 6a912c61aa user: js tags: trunk | |
2022-06-07
| ||
21:50 | OFArray: Remove/replace all objects check-in: a593419b75 user: js tags: trunk | |
19:50 | OFURL: Minor documentation fixes check-in: 022418ee31 user: js tags: trunk | |
Changes
Modified src/OFArray.h from [844dffab7b] to [b541f6a403].
︙ | |||
178 179 180 181 182 183 184 | 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | - - - + + | * @brief Creates a new OFArray with the objects from the specified C array of * the specified length. * * @param objects A C array of objects * @param count The length of the C array * @return A new autoreleased OFArray */ |
︙ | |||
434 435 436 437 438 439 440 | 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 | - + + - + | * @param array The array with objects to add * @return A new array with the objects from the specified array added */ - (OFArray OF_GENERIC(ObjectType) *)arrayByAddingObjectsFromArray: (OFArray OF_GENERIC(ObjectType) *)array; /** |
︙ |
Modified src/OFMutableAdjacentArray.m from [0c03af836c] to [210f8382ef].
︙ | |||
103 104 105 106 107 108 109 | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | - - | count = _array.count; for (size_t i = 0; i < count; i++) { if ([objects[i] isEqual: oldObject]) { [newObject retain]; [objects[i] release]; objects[i] = newObject; |
︙ | |||
169 170 171 172 173 174 175 | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | + + - + + | object = objects[i]; [_array removeItemAtIndex: i]; _mutations++; [object release]; objects = _array.items; i--; |
︙ | |||
192 193 194 195 196 197 198 | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | + + - + + | for (size_t i = 0; i < count; i++) { if (objects[i] == object) { [_array removeItemAtIndex: i]; _mutations++; [object release]; objects = _array.items; i--; |
︙ |
Modified src/OFMutableArray.h from [2f55547945] to [43a8133fa8].
︙ | |||
90 91 92 93 94 95 96 | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | - + | * @param array An array of objects * @param index The index where the objects should be inserted */ - (void)insertObjectsFromArray: (OFArray OF_GENERIC(ObjectType) *)array atIndex: (size_t)index; /** |
︙ | |||
129 130 131 132 133 134 135 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | - + - + - + | * @param oldObject The object to replace * @param newObject The replacement object */ - (void)replaceObjectIdenticalTo: (ObjectType)oldObject withObject: (ObjectType)newObject; /** |
︙ |
Modified src/OFMutableArray.m from [16cfb7990f] to [8e711f8f4a].
︙ | |||
291 292 293 294 295 296 297 | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | - - + + - - - | size_t count; if (oldObject == nil || newObject == nil) @throw [OFInvalidArgumentException exception]; count = self.count; |
︙ | |||
335 336 337 338 339 340 341 | 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | + - + + + - + + | count = self.count; for (size_t i = 0; i < count; i++) { if ([[self objectAtIndex: i] isEqual: object]) { [self removeObjectAtIndex: i]; i--; |
︙ |
Modified tests/OFArrayTests.m from [76dfc16c23] to [b0ef1c947a].
︙ | |||
206 207 208 209 210 211 212 | 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | - + + + | R([mutableArray1 replaceObjectAtIndex: 0 withObject: cArray[0]]) && [[mutableArray1 objectAtIndex: 0] isEqual: cArray[0]] && [[mutableArray1 objectAtIndex: 1] isEqual: cArray[0]] && [[mutableArray1 objectAtIndex: 2] isEqual: cArray[2]]) TEST(@"-[removeObject:]", R([mutableArray1 removeObject: cArray[0]]) && |
︙ |