This snippet vexes me in the collector collectI im...
# arrow-contributors
y
This snippet vexes me in the collector collectI implementation:
Copy code
val continued = when {
    collector.has(Characteristics.CONCURRENT, Characteristics.UNORDERED) ->
      started.parMapUnordered(concurrency) { collector.accumulate(accumulator, it) }
    collector.has(Characteristics.CONCURRENT) ->
      started.parMap(concurrency) { collector.accumulate(accumulator, it) }
    else -> started.map { collector.accumulate(accumulator, it) }
Specifically,
parMap
. From looking at its code, it seems that it's only ordered in the results that it produces (which are all
Unit
in this case), but the mapping itself happens in the same exact way as
parMapUnordered
. It thus seems unnecessarily expensive