Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -27,11 +27,11 @@ #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 left, id right); +typedef id (^of_array_fold_block_t)(id left, id right); #endif /** * \brief A class for storing objects in an array. */ @@ -283,26 +283,26 @@ * \return A new, autoreleased OFArray */ - (OFArray*)filteredArrayUsingBlock: (of_array_filter_block_t)block; /** - * \brief Reduces the array to a single object using the specified block. + * \brief Folds the array to a single object using the specified block. * * 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 left is always to what the array has already been - * reduced and right what should be added to left. + * folded and right what should be added to left. * - * \param block A block which reduces two objects into one, which is called for + * \param block A block which folds two objects into one, which is called for * all objects except the first - * \return The array reduced to a single object + * \return The array folded to a single object */ -- (id)reduceUsingBlock: (of_array_reduce_block_t)block; +- (id)foldUsingBlock: (of_array_fold_block_t)block; #endif @end @interface OFArrayEnumerator: OFEnumerator { Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -640,11 +640,11 @@ } return ret; } -- (id)reduceUsingBlock: (of_array_reduce_block_t)block +- (id)foldUsingBlock: (of_array_fold_block_t)block { size_t count = [array count]; __block id current; if (count == 0)