Skip to content

Commit

Permalink
Fix return value in asyncmap! (#23906)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Sep 28, 2017
1 parent 91b75cd commit 4d2e1d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/asyncmap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -420,5 +420,5 @@ returning a collection.
"""
function asyncmap!(f, r, c1, c...; ntasks=0, batch_size=nothing)
foreach(identity, AsyncCollector(f, r, c1, c...; ntasks=ntasks, batch_size=batch_size))
c
r
end
3 changes: 2 additions & 1 deletion test/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,9 @@ function test_map(::Type{TestAbstractArray})
# Map to destination collection
map!((x,y,z)->x*y*z, A, Float64[1:10...], Float64[1:10...], Float64[1:10...])
@test A == map(x->x*x*x, Float64[1:10...])
Base.asyncmap!((x,y,z)->x*y*z, B, Float64[1:10...], Float64[1:10...], Float64[1:10...])
C = Base.asyncmap!((x,y,z)->x*y*z, B, Float64[1:10...], Float64[1:10...], Float64[1:10...])
@test A == B
@test B === C
end

@testset "issue #15689, mapping an abstract type" begin
Expand Down

0 comments on commit 4d2e1d7

Please sign in to comment.