Synopsis: | Do not return from unexpected locations |
Language: | C++ |
Severity Level: | 9 |
Category: | Control Flow |
Description: |
It is harder to understand a function if, reading it at the bottom, you are unaware of the possibility that it returned somewhere above. So multiple returns in a function should be avoided, if possible. However, in some situations it is perfectly legal to have extra returns. Examples are:
|