create slice with capacity, when capacity is known#5
Conversation
|
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 |
|
Message from Bryan C. Mills: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/203722. |
This reduces the number of allocations made to the underlying array, while append() attempts to 'grow' the slice beyond its initial capacity
|
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 |
|
Message from aditya harindar: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/203722. |
|
Message from Bryan C. Mills: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/203722. |
|
Message from aditya harindar: Patch Set 3: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/203722. |
|
Message from Bryan C. Mills: Patch Set 4: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/203722. |
This reduces the number of allocations made to the underlying array, while append() attempts to 'grow' the slice beyond its initial capacity