Forked from
Debian / ruby-in-parallel
Source project has a limited visibility.
-
Nick Lewis authored
For Enumerables containing 0 or 1 items, the #each_in_parallel method was improperly calling the block without an argument, then calling it again properly but not returning the result of the block. The #each method returns the Enumerable that was it was called on, rather than the value of the block. This needs to be #map instead, to actually return an array of the one or zero values. The tests weren't catching this because they were effectively passing `identity` as the block, nullifying the distinction between #each and #map.
Nick Lewis authoredFor Enumerables containing 0 or 1 items, the #each_in_parallel method was improperly calling the block without an argument, then calling it again properly but not returning the result of the block. The #each method returns the Enumerable that was it was called on, rather than the value of the block. This needs to be #map instead, to actually return an array of the one or zero values. The tests weren't catching this because they were effectively passing `identity` as the block, nullifying the distinction between #each and #map.