Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. boolean isValid = true;
  2.  
  3. if (isValid && expensiveCheck1()) { ... }
  4. if (isValid && expensiveCheck2()) { ... }
  5.  
  6. // 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