This may sound like a silly question, and I hesitated to post it, but still:
if something needs to run only in a certain condition, which of these is more efficient:
Performance is more or less the same in both the cases. Therefore it becomes more of a style or preference question.
I personally prefer writing if--> return i.e. case B because it makes the code to look cleaner and easy to read specially if the code comprises of complex nested conditions.