Skip to content

Commit

Permalink
Made unrolled_in inline
Browse files Browse the repository at this point in the history
  • Loading branch information
cstjean committed Oct 22, 2017
1 parent 3e31a73 commit 9026cec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Unrolled.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ end
@generated function unrolled_map(f, seq)
:(tuple($((:(f(seq[$i])) for i in 1:type_length(seq))...)))
end
@generated function unrolled_map(f, seq1, seq2)
@generated function unrolled_map(f::F, seq1, seq2) where F
@assert type_length(seq1) == type_length(seq2)
:(tuple($((:(f(seq1[$i], seq2[$i])) for i in 1:type_length(seq1))...)))
end
Expand All @@ -157,7 +157,7 @@ unrolled_union(tup1, tup2, tupn...) =
unrolled_reduce(unrolled_union, tup1, (tup2, tupn...))
""" `unrolled_in(obj, tup)` is like `in`. Beware that its return type is not
always known - see #21322 """
@unroll function unrolled_in(obj, tup)
@inline @unroll function unrolled_in(obj, tup)
@unroll for x in tup
if obj == x
return true
Expand Down

0 comments on commit 9026cec

Please sign in to comment.