Skip to content

Commit

Permalink
zip'
Browse files Browse the repository at this point in the history
  • Loading branch information
mcabbott committed Jan 11, 2022
1 parent 7ea132d commit 24c05c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tangent_types/abstract_zero.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ function _promote_vectors(x::AbstractVector, y::AbstractVector)
if isconcretetype(T)
return convert(T, x), convert(T, y)
else
short = map(Base.splat(first promote), zip(x, y))
if VERSION > v"1.4"
short = map(first promote, x, y)
else # on 1.0 and friends, neither map nor zip stop early. So we improvise
short = [promote(x[i], y[i])[1] for i in intersect(axes(x, 1), axes(y, 1))]
end
return convert(typeof(short), x), convert(typeof(short), y)
end
end
Expand Down

0 comments on commit 24c05c3

Please sign in to comment.