Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using internals: Base.copymutable [NFC] #1219

Merged
merged 2 commits into from
Nov 16, 2023

Conversation

LilithHafner
Copy link
Contributor

I inlined the implementations to the call sites which, remarkably, improves concision.

src/sort.jl Outdated Show resolved Hide resolved
Co-authored-by: Thomas Christensen <[email protected]>
@mateuszbaran
Copy link
Collaborator

Why did you replace Base.copymutable(a) with copyto!(similar(a), a) in one place but collect(a) in the other?

@LilithHafner
Copy link
Contributor Author

Because

julia> @less Base.copymutable([1,2,3])
function copymutable(a::AbstractArray)
    @_propagate_inbounds_meta
    copyto!(similar(a), a)
end
copymutable(itr) = collect(itr)

@mateuszbaran
Copy link
Collaborator

I see, it makes sense.

@thchr thchr merged commit d419e21 into JuliaArrays:master Nov 16, 2023
20 of 27 checks passed
@LilithHafner LilithHafner deleted the patch-1 branch November 16, 2023 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants