ObjFW  Check-in [030cc6df0e]

Overview
Comment:Rename object1 and object2 to left and right in -[reduceWithBlock:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 030cc6df0ecc6d8bbfe61d83082f01e65fa2ff4d14f1f2394a98376afb14c59b
User & Date: js on 2011-07-22 18:59:23
Other Links: manifest | tags
Context
2011-07-22
18:59
Rename object1 and object2 to left and right in -[reduceWithBlock:]. check-in: 030cc6df0e user: js tags: trunk
18:49
Improve methods using blocks in OFArray. check-in: f9b3ec49f8 user: js tags: trunk
17:03
Improve methods using blocks in OFDictionary. check-in: 6214a3be25 user: js tags: trunk
Changes

Modified src/OFArray.h from [a35efcabab] to [825d39ec6d].

25
26
27
28
29
30
31
32

33
34
35
36
37
38
39
25
26
27
28
29
30
31

32
33
34
35
36
37
38
39







-
+







@class OFString;

#ifdef OF_HAVE_BLOCKS
typedef void (^of_array_enumeration_block_t)(id object, size_t index,
    BOOL *stop);
typedef BOOL (^of_array_filter_block_t)(id odject, size_t index);
typedef id (^of_array_map_block_t)(id object, size_t index);
typedef id (^of_array_reduce_block_t)(id object1, id object2);
typedef id (^of_array_reduce_block_t)(id left, id right);
#endif

/**
 * \brief A class for storing objects in an array.
 */
@interface OFArray: OFObject <OFCopying, OFMutableCopying, OFCollection,
    OFSerialization>
289
290
291
292
293
294
295
296
297


298
299
300
301
302
303
304
289
290
291
292
293
294
295


296
297
298
299
300
301
302
303
304







-
-
+
+







 *
 * If the array is empty, it will return nil.
 *
 * If there is only one object in the array, that object will be returned and
 * the block will not be invoked.
 *
 * If there are at least two objects, the block is invoked for each object
 * except the first, where object1 is always to what the array has already been
 * reduced and object2 what should be added to object1.
 * except the first, where left is always to what the array has already been
 * reduced and right what should be added to left.
 *
 * \param block A block which reduces two objects into one, which is called for
 *		all objects except the first
 * \return The array reduced to a single object
 */
- (id)reduceUsingBlock: (of_array_reduce_block_t)block;
#endif