Skip to content

Commit c20360a

Browse files
committed
zip'
1 parent 46653aa commit c20360a

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
@@ -84,7 +84,11 @@ function _promote_vectors(x::AbstractVector, y::AbstractVector)
8484
if isconcretetype(T)
8585
return convert(T, x), convert(T, y)
8686
else
87-
short = map(Base.splat(first promote), zip(x, y))
87+
if VERSION > v"1.4"
88+
short = map(first promote, x, y)
89+
else # on 1.0 and friends, neither map nor zip stop early. So we improvise
90+
short = [promote(x[i], y[i])[1] for i in intersect(axes(x, 1), axes(y, 1))]
91+
end
8892
return convert(typeof(short), x), convert(typeof(short), y)
8993
end
9094
end

0 commit comments

Comments
 (0)