DEV Community

Discussion on: Don't ALWAYS quick-return from functions

Collapse
 
benwinding profile image
Ben Winding

Thanks for the feedback Andrew! I've fixed the last example code in order to better demonstrate what I meant.

Yes, the argument I was trying to make is mainly concerned, but not limited to garbage collection. Actually, any resource may need to be 'freed' at the end of the function; boolean locks, system resources etc...

Also fixed the bug you spotted, thanks!

Collapse
 
buntine profile image
Andrew Buntine

Yeah, nice one. The last example demonstrates the concept much better now.