-
Notifications
You must be signed in to change notification settings - Fork 13
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
Implement deleteat! and append! #23
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.
Looks good. append!
is probably even more safe than what we have in _vcat
below 😄.
This doesn't support |
The problem is that in Julia 1.0 this is not present so if we aim at long-term support maybe we should conditionally define them (and now they would always be defined in the package)? |
itemindices = eachindex(items) | ||
l = length(pv) | ||
n = length(itemindices) | ||
resize!(pv.refs, l+n) |
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.
This would ensure entries are set to #undef
in case conversion fails for some values:
resize!(pv.refs, l+n) | |
resize!(pv, l+n) |
That's not what happens for Array
s of isbits
types, but maybe that's worth it here given that PooledArray
is mostly useful for non-isbits
types? Otherwise, leaving refs undefined could trigger crashes.
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.
I understand that you are afraid that later copyto!
will not set the proper values there?
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.
Yes, if conversion fails it will stop in the middle AFAIK.
Yeah, but honestly I don't really care. :-) At least let's get this included in Base first so that we know what |
I think that we should care :), I answer SO a lot, and people report there often that they are stuck with 1.0 when I give them some solutions that use 1.1 features. |
Also |
Bump. |
I think it is good to merge. Adding other |
bump (as this package is getting used more by the community and the problem is repeatedly reported) |
@shashi @JeffBezanson OK to merge? |
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.
Looks good. I forgot I have access rights here.
@quinnj can you also please tag a release then? Thank you. |
Fixes #22.