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
Since the func always receives n, receiving n.Method() is redundant.
Other redundant cases that come to mind, when a func receives x:
x.Field
x[i]
x[i:j]
*x
And of course, any combination of the above.
I'm leaving x.PureMethod() and PureFunc(x) out of the list as that's a much more complex one - we'd have to figure out that the func has no side effects. I don't think SSA does this just yet.
The text was updated successfully, but these errors were encountered:
For example, take this Golang CL: https://go-review.googlesource.com/c/go/+/100455
The func was always called like:
Since the func always receives
n
, receivingn.Method()
is redundant.Other redundant cases that come to mind, when a func receives
x
:And of course, any combination of the above.
I'm leaving
x.PureMethod()
andPureFunc(x)
out of the list as that's a much more complex one - we'd have to figure out that the func has no side effects. I don't think SSA does this just yet.The text was updated successfully, but these errors were encountered: