You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type T struct { a, b, c int } func f(t *T) { *t = T{3,4,5} }
We currently generate a copy from a statictmp to initialize *t. We should instead generate the equivalent of t.a=3;t.b=4;t.c=5.
We should certainly do this for structs that are small and contain no pointers. How large we should go and whether it would be worth it to do so for structs with pointers is TBD. (Possible rule - do this for <= 1 pointer structures.)
type T struct { a, b, c int } func f(t *T) { *t = T{3,4,5} }
We currently generate a copy from a statictmp to initialize *t. We should instead generate the equivalent of t.a=3;t.b=4;t.c=5.
We should certainly do this for structs that are small and contain no pointers. How large we should go and whether it would be worth it to do so for structs with pointers is TBD. (Possible rule - do this for <= 1 pointer structures.)
See also issue #18370
@mdempsky
The text was updated successfully, but these errors were encountered: