Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. // no goto
  2.  
  3. var compute_a = some_func_0();
  4. if (test_condition_a)
  5. {
  6. var compute_b = some_func_1();
  7. if (test_condition_b(compute_b))
  8. {
  9. var compute_c = some_func_2();
  10. if (test_condition_c(compute_c))
  11. {
  12. var compute_d = some_func_3();
  13. if (test_condition_d(compute_d))
  14. {
  15. // actual business logic here
  16. }
  17. }
  18. }
  19. }
  20.  
  21.  
  22. // goto
  23.  
  24. var compute_a = some_func_0();
  25. if (!test_condition_a(compute_a))
  26. goto SKIP;
  27. var compute_b = some_func_1();
  28. if (!test_condition_b)
  29. goto SKIP;
  30. var compute_c = some_func_2();
  31. if (!test_condition_c(compute_c))
  32. goto SKIP;
  33. var compute_d = some_func_3();
  34. if (!test_condition_d(compute_d))
  35. goto SKIP;
  36.  
  37. // actual business logic here
  38.  
  39. SKIP: ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement