Skip to content

Commit

Permalink
zip'
Browse files Browse the repository at this point in the history
  • Loading branch information
mcabbott committed Jan 31, 2022
1 parent a250bcb commit 508cb75
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 @@ -84,7 +84,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 508cb75

Please sign in to comment.