-
Notifications
You must be signed in to change notification settings - Fork 18k
proposal: slices: add Clear
function
#60136
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
Comments
oldLen := len(s)
s = DoDelete(s)
s = DoCompact(s)
s = DoFoo(s)
slices.Clear(s, oldLen) This is because it can be a reasonable assumption to assume what was already free capacity was already zeroed, what would need to be rezeroed would just be the range between the old len and the new len (since we expect remanents from |
I don't yet see a need for a |
I somehow overlooked that, this would require |
sgtm ty |
Rational
Compact*
andDelete*
have this comment:Clear
would make it easy to perform this operation.The text was updated successfully, but these errors were encountered: