Browse Source

Formatting change: while-condition loop to do-while loop.

pull/2134/head
Siegfried Pammer 5 years ago
parent
commit
e320819103
  1. 9
      ICSharpCode.Decompiler/IL/Transforms/SwitchOnStringTransform.cs

9
ICSharpCode.Decompiler/IL/Transforms/SwitchOnStringTransform.cs

@ -252,7 +252,10 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -252,7 +252,10 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return false;
// extract all cases and add them to the values list.
ILInstruction nextCaseBlock;
while ((nextCaseBlock = MatchCaseBlock(currentCaseBlock, switchValueVar, out string value, out bool emptyStringEqualsNull, out ILInstruction block)) != null) {
do {
nextCaseBlock = MatchCaseBlock(currentCaseBlock, switchValueVar, out string value, out bool emptyStringEqualsNull, out ILInstruction block);
if (nextCaseBlock == null)
break;
if (emptyStringEqualsNull && string.IsNullOrEmpty(value)) {
if (!AddSwitchSection(null, block))
return false;
@ -263,9 +266,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -263,9 +266,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return false;
}
currentCaseBlock = nextCaseBlock as Block;
if (currentCaseBlock == null)
break;
}
} while (currentCaseBlock != null);
// We didn't find enough cases, exit
if (values.Count < 3)

Loading…
Cancel
Save