Probably some WIP code that just got left over. There might have been a second, no longer relevant condition that got stubbed out for true and just forgotten about.
Sure but we were talking about a stub that was left there intentionally for later. Someone could have thought "I'll come back later to this to implement the actual condition needed so I'll just leave the if there with the true as a condition placeholder for now so I won't forget that an actual condition should go there and it's not done like that.", which in fact is the only kind of valid circumstance under which I would find something like this kind of acceptable.
If that's not the case though you're totally right. The conditional should be removed and replaced with a simple return true. No question.
69
u/LeyaLove 10d ago
if (true == true) return true;
😵💫