Skip to content

Commit c97aafd

Browse files
committed
zip'
1 parent 2be9e30 commit c97aafd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tangent_types/abstract_zero.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ function _promote_vectors(x::AbstractVector, y::AbstractVector)
8080
if isconcretetype(T)
8181
return convert(T, x), convert(T, y)
8282
else
83-
short = map(Base.splat(first promote), zip(x, y))
83+
if VERSION > v"1.4"
84+
short = map(first promote, x, y)
85+
else # on 1.0 and friends, neither map nor zip stop early. So we improvise
86+
short = [promote(x[i], y[i])[1] for i in intersect(axes(x, 1), axes(y, 1))]
87+
end
8488
return convert(typeof(short), x), convert(typeof(short), y)
8589
end
8690
end

0 commit comments

Comments
 (0)