Differences From Artifact [56c9de1a04]:
- File src/OFArray.m — part of check-in [daae7ffbf3] at 2010-01-30 15:47:44 on branch trunk — Make OFEnumerator more general, implement it for OFArray & OFDictionary. (user: js, size: 5979) [annotate] [blame] [check-ins using]
To Artifact [323e66f686]:
- File
src/OFArray.m
— part of check-in
[b91a8283fe]
at
2010-03-05 11:52:18
on branch 0.2
— Merge a few changesets from the default branch into the 0.2 branch.
Changesets:
* b95fcaa6d694
* 804c68d222b4
* da8cd738da3d
* 1109d5ce3419
* d03f5c1ca95d
* 2a7017722165
* 4fccdc79eeb7
* d228149fbc04
* 8782d412a4a6 (user: js, size: 6055) [annotate] [blame] [check-ins using]
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. |
︙ | ︙ | |||
223 224 225 226 227 228 229 230 231 232 233 234 235 236 | OFString *str; OFString **objs = [array cArray]; size_t i, count = [array count]; IMP append; if (count == 0) return @""; str = [OFMutableString string]; append = [str methodForSelector: @selector(appendString:)]; for (i = 0; i < count - 1; i++) { append(str, @selector(appendString:), objs[i]); append(str, @selector(appendString:), separator); | > > | 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | OFString *str; OFString **objs = [array cArray]; size_t i, count = [array count]; IMP append; if (count == 0) return @""; if (count == 1) return [objs[0] retain]; str = [OFMutableString string]; append = [str methodForSelector: @selector(appendString:)]; for (i = 0; i < count - 1; i++) { append(str, @selector(appendString:), objs[i]); append(str, @selector(appendString:), separator); |
︙ | ︙ | |||
319 320 321 322 323 324 325 326 327 328 329 330 331 332 | [array release]; [super dealloc]; } @end @implementation OFArrayEnumerator - initWithDataArray: (OFDataArray*)array_ mutationsPointer: (unsigned long*)mutations_ptr_; { self = [super init]; array = array_; | > | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | [array release]; [super dealloc]; } @end /// \cond internal @implementation OFArrayEnumerator - initWithDataArray: (OFDataArray*)array_ mutationsPointer: (unsigned long*)mutations_ptr_; { self = [super init]; array = array_; |
︙ | ︙ | |||
354 355 356 357 358 359 360 | @throw [OFEnumerationMutationException newWithClass: isa]; pos = 0; return self; } @end | > | 357 358 359 360 361 362 363 364 | @throw [OFEnumerationMutationException newWithClass: isa]; pos = 0; return self; } @end /// \endcond |