That is precisely what I mean; but also note that there are circumstances in the ancestral environment in which pain is entirely useless, such as when one has been mortally wounded. So even in the worst case we can do better than pain, and in the current case I suspect we can do much, much better.
Evolution has the problem of path-dependence, though. Once the "don't do that" / "pay attention to that" mechanism builds up slowly over many generations, it cannot refactor in such a way that it surgically cuts out the internal feeling of pain in precisely those circumstances where, "hey, might as well give up".
This is our monthly thread for collecting these little gems and pearls of wisdom, rationality-related quotes you've seen recently, or had stored in your quotesfile for ages, and which might be handy to link to in one of our discussions.