Open soxjke opened 7 years ago
When initial value is set to nil and the array consists of single item, this item is returned and reduce block is never evaluated.
nil
There seems to be an issue at https://github.com/supermarin/ObjectiveSugar/blob/master/Classes/NSArray%2BObjectiveSugar.m#L178
I would rather write it as
accumulator = block(accumulator, object);
Does this make sense?
When initial value is set to
nil
and the array consists of single item, this item is returned and reduce block is never evaluated.There seems to be an issue at https://github.com/supermarin/ObjectiveSugar/blob/master/Classes/NSArray%2BObjectiveSugar.m#L178
I would rather write it as
Does this make sense?