Can these ternary expression with expensive method calls be simplified without outline variables ...
I do NOT want to
- call expensive methods more than once. - make "outline" temporary variables. Outline variables are ones declared outside ternary expressions. - leak variables with letters.
var out1 = ExpensiveMethod1(x, y) is bool __ ? __.ToString() : "null";var out2 = ExpensiveMethod2(x, y) is bool ___ ? ___.ToString() : "null";var out3 = ExpensiveMethod3(x, y) is bool ____ ? ____.ToString() : "null";
var out1 = ExpensiveMethod1(x, y) is bool __ ? __.ToString() : "null";var out2 = ExpensiveMethod2(x, y) is bool ___ ? ___.ToString() : "null";var out3 = ExpensiveMethod3(x, y) is bool ____ ? ____.ToString() : "null";