4 ms·
The mentality of using a single return statement at the end of a function comes from languages that require memory management. In these languages if you return
by gigq 13y ago
The mentality of using a single return statement at the end of a function comes from languages that require memory management. In these languages if you return early you would cause a leak by not releasing your resources at the bottom of the function before returning.
http://programmers.stackexchange.com/a/118717 http://programmers.stackexchange.com/a/118717