Created
July 1, 2016 02:22
-
-
Save poemdexter/7816a18bd1673ca1b65567a0b6b50eee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean isValid = true; | |
if (isValid && expensiveCheck1()) { ... } | |
if (isValid && expensiveCheck2()) { ... } | |
// expensiveCheck1() and expensiveCheck2() should set isValid = false if needed to short circuit rest of validations |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment