これを解決するエレガントな方法はありますか?
if (condition0) {
if(condition1) {
do thing 1
}
else if(condition2){
do thing 2
}
}
else {
if(condition2) {
do thing 2
}
else if(condition1){
do thing 1
}
}
do thing 1
多くのパラメーターを使用した関数呼び出しとdo thing 2
、どういうわけか不必要な繰り返しがあるようです。
これを行うより良い方法はありますか?