Return statements in blocks return from not only the block but also from the method that contains the block. This means returns cannot be used for exiting early from option filtering blocks. Using lambdas instead allows us to use return statements to exit early from the filtering logic without affecting the surrounding method.
5.9 KiB
5.9 KiB