Skip to content

Commit 04bb602

Browse files
committed
refactor: clean up copies
1 parent 6e41726 commit 04bb602

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Evaluate.jl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,17 @@ function get_filled_array(::Nothing, value, template::AbstractArray, axes...)
5656
end
5757
function get_filled_array(buffer::ArrayBuffer, value, template::AbstractArray, axes...)
5858
i = next_index!(buffer)
59-
out = @view(buffer.array[i, :])
60-
out .= value
61-
return out
59+
@inbounds buffer.array[i, :] .= value
60+
return @view(buffer.array[i, :])
6261
end
6362

6463
function get_feature_array(::Nothing, X::AbstractMatrix, feature::Integer)
65-
return X[feature, :]
64+
return @inbounds(X[feature, :])
6665
end
6766
function get_feature_array(buffer::ArrayBuffer, X::AbstractMatrix, feature::Integer)
6867
i = next_index!(buffer)
69-
out = @view(buffer.array[i, :])
70-
out .= X[feature, :]
71-
return out
68+
@inbounds buffer.array[i, :] .= X[feature, :]
69+
return @view(buffer.array[i, :])
7270
end
7371

7472
"""

0 commit comments

Comments
 (0)