-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Missing tests for IdSet #56258
Missing tests for IdSet #56258
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1037,6 +1037,8 @@ end | |||
@test !isempty(A) | |||
A = empty!(A) | |||
@test isempty(A) | |||
@test isnothing(sizehint!(A, 10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better way to test this sizehint!()
call? Maybe by looking at the length of .ht
before and after the sizehint!()
call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a new TODO
?
Lines 81 to 93 in 10f294b
function sizehint!(s::IdSet, newsz) | |
# TODO: grow/compact list and perform rehash, if profitable? | |
# TODO: shrink? | |
# s.list = resize(s.list, newsz) | |
# newsz = _tablesz(newsz) | |
# oldsz = length(s.idxs) | |
# #grow at least 25% | |
# if newsz < (oldsz*5)>>2 | |
# return s | |
# end | |
# rehash!(s, newsz) | |
nothing | |
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't realize it was currently a no-op.
@@ -1037,6 +1037,8 @@ end | |||
@test !isempty(A) | |||
A = empty!(A) | |||
@test isempty(A) | |||
@test isnothing(sizehint!(A, 10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test isnothing(sizehint!(A, 10)) | |
@test isnothing(sizehint!(A, 10)) # Currently a no-op. TODO: Add a better test once the functionality has been implemented. |
No description provided.