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

create slice with capacity, when capacity is known #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

create slice with capacity, when capacity is known #5

wants to merge 1 commit into from

Conversation

AdityaHarindar
Copy link

@AdityaHarindar AdityaHarindar commented Oct 28, 2019

This reduces the number of allocations made to the underlying array, while append() attempts to 'grow' the slice beyond its initial capacity

@gopherbot
Copy link
Contributor

This PR (HEAD: da3a7cb) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/playground/+/203722 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Bryan C. Mills:

Patch Set 1:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/203722.
After addressing review feedback, remember to publish your drafts!

This reduces the number of allocations made to the underlying array, while append() attempts to 'grow' the slice beyond its initial capacity
@gopherbot
Copy link
Contributor

This PR (HEAD: d25b90c) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/playground/+/203722 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from aditya harindar:

Patch Set 1:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/203722.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Bryan C. Mills:

Patch Set 2:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/203722.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from aditya harindar:

Patch Set 3:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/203722.
After addressing review feedback, remember to publish your drafts!

@bcmills bcmills changed the title Add capacity to slice creation, when capacity is known create slice with capacity, when capacity is known Nov 5, 2019
@gopherbot
Copy link
Contributor

Message from Bryan C. Mills:

Patch Set 4:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/203722.
After addressing review feedback, remember to publish your drafts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants