Conversation
}]; | ||
|
||
*/ | ||
- (NSInteger)reduceInt:(NSInteger)initial WithBlock:(BKAccumulationBlockInt)block; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason the w
in with
is capitalized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. I will fix it.
2013/12/1 segiddins notifications@github.com
In BlocksKit/NSArray+BlocksKit.h:
- NSArray *peoples = @[p1, p2, p3];
- int totalAge = 0;
- for (People *people in peoples) {
- totalAge += [people age];
- }
+- We can use block to make it better:
+- NSArray *peoples = @[p1, p2, p3];
- int totalAge = [peoples reduceInt:0 WithBlock:^int(NSInteger result, id obj, NSInteger index) {
- return result + [obj age];
- }];
+- */
+- (NSInteger)reduceInt:(NSInteger)initial WithBlock:(BKAccumulationBlockInt)block;any reason the w in with is capitalized?
—
Reply to this email directly or view it on GitHubhttps://github.com/pandamonia/BlocksKit/pull/184/files#r8011548
.
陈育龙 移动端负责人, ELEME Inc.
Email:andy.chen@ele.me | Mobile: 86+159-2154-3125
http://ele.me 饿了么?
@segiddins it's done, thanks. |
Also, could you rename |
ok. |
@segiddins done. thanks. |
@segiddins anything else to be refactored? |
@zwaldowski I don't know why it is closed instead of merged. |
This was merged. See 0cc231f. |
thanks |
add basic type reduce support.