Does self pleasure effect gym?

Does it affect muscle gain and weight gain? Does it have any impact on gym performance or recovery?

I have listened to multiple opinions and perspectives on this topic. I still don’t understand whether it really matters or not.

What if a person takes protein and another basic supplements and a basic diet, does this matter.