Consider this pseudo code:
if(p){ foo() bar1() } if else(q){ foo() bar2() }
Is there a way of avoiding writing the call for function foo() twice? I could write:
if(p||q){ foo() } ...
But is that the only solution?
Aucun commentaire:
Enregistrer un commentaire