|
|
@ -198,6 +198,10 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow |
|
|
|
if (ifCount < labelCount) |
|
|
|
if (ifCount < labelCount) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// don't create switch statements with only one non-default label (provided the if option is short enough)
|
|
|
|
|
|
|
|
if (analysis.Sections.Count == 2 && ifCount <= 2) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
// if there is no ILSwitch, there's still many control flow patterns that
|
|
|
|
// if there is no ILSwitch, there's still many control flow patterns that
|
|
|
|
// match a switch statement but were originally just regular if statements,
|
|
|
|
// match a switch statement but were originally just regular if statements,
|
|
|
|
// and converting them to switches results in poor quality code with goto statements
|
|
|
|
// and converting them to switches results in poor quality code with goto statements
|
|
|
|