Browse Source

StatementBuilder: do not insert continue statement at end of loop, if it's already present.

pull/1296/head
Siegfried Pammer 7 years ago
parent
commit
fbb3f230d0
  1. 2
      ICSharpCode.Decompiler/CSharp/StatementBuilder.cs

2
ICSharpCode.Decompiler/CSharp/StatementBuilder.cs

@ -928,7 +928,7 @@ namespace ICSharpCode.Decompiler.CSharp
} }
string label; string label;
if (endContainerLabels.TryGetValue(container, out label)) { if (endContainerLabels.TryGetValue(container, out label)) {
if (isLoop) { if (isLoop && !(blockStatement.LastOrDefault() is ContinueStatement)) {
blockStatement.Add(new ContinueStatement()); blockStatement.Add(new ContinueStatement());
} }
blockStatement.Add(new LabelStatement { Label = label }); blockStatement.Add(new LabelStatement { Label = label });

Loading…
Cancel
Save