Skip to content

Commit

Permalink
Avoid converting twice
Browse files Browse the repository at this point in the history
`_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.
  • Loading branch information
ararslan committed Sep 28, 2022
1 parent 947b7f3 commit 5479278
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/BetaRegression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ function BetaRegressionModel(X::AbstractMatrix, y::AbstractVector,
η = Vector{T}(undef, n)
_X = convert(AbstractMatrix{T}, X)
_y = convert(AbstractVector{T}, y)
return BetaRegressionModel{T,typeof(link),typeof(_y),typeof(_X)}(y, X, weights, offset,
parameters, η)
return BetaRegressionModel{T,typeof(link),typeof(_y),typeof(_X)}(_y, _X, weights,
offset, parameters, η)
end

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

2 comments on commit 5479278

@ararslan
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/72473

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 5479278b23a7d31c3477b10059c5e7a8d26c274f
git push origin v0.1.0

Please sign in to comment.