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

[Utilities] Re-enable allocation test from #2018 #2034

Merged
merged 6 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Utilities/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ function _sort_and_compress!(x::Vector)
if length(x) == 0
return
end
sort!(x; by = MOI.term_indices)
sort!(x, QuickSort, Base.Order.ord(isless, MOI.term_indices, false))
odow marked this conversation as resolved.
Show resolved Hide resolved
i = 1
@inbounds for j in 2:length(x)
if MOI.term_indices(x[i]) == MOI.term_indices(x[j])
Expand Down
4 changes: 3 additions & 1 deletion test/Utilities/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,9 @@ function _test_canonicalization(
@test MOI.Utilities.canonical(g) !== g
# There are some changes to sorting in Julia v1.9 that now mean sorting
# allocates.
# @test @allocated(MOI.Utilities.canonicalize!(f)) == 0
if VERSION < v"1.9"
odow marked this conversation as resolved.
Show resolved Hide resolved
@test @allocated(MOI.Utilities.canonicalize!(f)) == 0
end
return
end

Expand Down