@@ -44,29 +44,25 @@ function eachcolumn end
44
44
45
45
@inline function eachcolumn (f:: Base.Callable , sch:: Schema{names, types} , row, args... ) where {names, types}
46
46
if @generated
47
- if length (names) < 100
48
- b = Expr (:block , Any[:(f (getproperty (row, $ (Meta. QuoteNode (names[i]))), $ i, $ (Meta. QuoteNode (names[i])), args... )) for i = 1 : length (names)]. .. )
49
- else
50
- rle = runlength (types)
51
- if length (rle) < 100
52
- block = Expr (:block )
53
- i = 1
54
- for (T, len) in rle
55
- push! (block. args, quote
56
- for j = 0 : $ (len- 1 )
57
- f (getproperty (row, $ T, $ i + j, names[$ i + j]), $ i + j, names[$ i + j], args... )
58
- end
59
- end )
60
- i += len
61
- end
62
- b = block
63
- else
64
- b = quote
65
- for (i, nm) in enumerate (names)
66
- f (getproperty (row, fieldtype (types, i), i, nm), i, nm, args... )
47
+ rle = runlength (types)
48
+ if length (rle) < 100
49
+ block = Expr (:block )
50
+ i = 1
51
+ for (T, len) in rle
52
+ push! (block. args, quote
53
+ for j = 0 : $ (len- 1 )
54
+ f (getproperty (row, $ T, $ i + j, names[$ i + j]), $ i + j, names[$ i + j], args... )
67
55
end
68
- return
56
+ end )
57
+ i += len
58
+ end
59
+ b = block
60
+ else
61
+ b = quote
62
+ for (i, nm) in enumerate (names)
63
+ f (getproperty (row, fieldtype (types, i), i, nm), i, nm, args... )
69
64
end
65
+ return
70
66
end
71
67
end
72
68
# println(b)
0 commit comments