Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- boolean isValid = true;
- if (isValid && expensiveCheck1()) { ... }
- if (isValid && expensiveCheck2()) { ... }
- // expensiveCheck1() and expensiveCheck2() should set isValid = false if needed to short circuit rest of validations
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement