Skip to content

Commit 24c05c3

Browse files
committed
zip'
1 parent 7ea132d commit 24c05c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/tangent_types/abstract_zero.jl

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

0 commit comments

Comments
 (0)