On Thu, Sep 8, 2016 at 3:32 PM T L <tapir....@gmail.com> wrote: > With the enough initial size, the underlying hashtable of the new map will never need to be realloced in the whole copy process.
For example dst := make(map[T]U, len(src)) See also https://golang.org/ref/spec#Making_slices_maps_and_channels BTW: The whole "never need to be realloced in the whole copy process" thing depends on unspecified implementation details and to me it feels like premature optimization. Especially if not supported by first doing some benchmarks that proved the/any/substantial difference. -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.