Skip to content

Commit 5479278

Browse files
committed
Avoid converting twice
`_X` and `_y` are defined to be the result of `convert` on `X` and `y` but I was accidentally using `X` and `y` rather than `_X` and `_y` in the `BetaRegressionModel` constructor, which means `convert` is called a second time unnecessarily.
1 parent 947b7f3 commit 5479278

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BetaRegression.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ function BetaRegressionModel(X::AbstractMatrix, y::AbstractVector,
118118
η = Vector{T}(undef, n)
119119
_X = convert(AbstractMatrix{T}, X)
120120
_y = convert(AbstractVector{T}, y)
121-
return BetaRegressionModel{T,typeof(link),typeof(_y),typeof(_X)}(y, X, weights, offset,
122-
parameters, η)
121+
return BetaRegressionModel{T,typeof(link),typeof(_y),typeof(_X)}(_y, _X, weights,
122+
offset, parameters, η)
123123
end
124124

125125
function Base.show(io::IO, b::BetaRegressionModel{T,L}) where {T,L}

0 commit comments

Comments
 (0)