Mark Volkmann <r.mark.volkm...@gmail.com> once said: > Suppose myPtr is a pointer and I write code like this: > > for _, v := range values { > fmt.Printf("%v %v\n", *myPtr, v) > } > > Will the Go compiler optimize the pointer dereference so it doesn't happen > in every loop iteration? If not, is it common practice to do that outside > the loop like this?
The comments on https://github.com/golang/go/issues/15635 may be of particular interest. Anthony -- 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.