Browse Source

Fix Using pretty tests and remove semicolon on single-line if.

pull/887/head
Siegfried Pammer 9 years ago
parent
commit
38482888a1
  1. 2
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Using.cs
  2. 2
      ICSharpCode.Decompiler/IL/Transforms/InlineReturnTransform.cs

2
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Using.cs

@ -58,7 +58,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void SimpleUsingExpressionStatementWithDeclaration() public void SimpleUsingExpressionStatementWithDeclaration()
{ {
using (MemoryStream memoryStream = new MemoryStream()) { using (MemoryStream memoryStream = new MemoryStream()) {
memoryStream.WriteByte((byte)42); memoryStream.WriteByte(42);
Console.WriteLine("using-body: " + memoryStream.Position); Console.WriteLine("using-body: " + memoryStream.Position);
} }
} }

2
ICSharpCode.Decompiler/IL/Transforms/InlineReturnTransform.cs

@ -39,7 +39,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
if (!leave.Value.MatchLdLoc(out var returnVar) || returnVar.Kind != VariableKind.Local) if (!leave.Value.MatchLdLoc(out var returnVar) || returnVar.Kind != VariableKind.Local)
continue; continue;
// If all instructions can be modified, add item to the global list. // If all instructions can be modified, add item to the global list.
if (CanModifyInstructions(returnVar, leaveBlock, out var list)); if (CanModifyInstructions(returnVar, leaveBlock, out var list))
instructionsToModify.AddRange(list); instructionsToModify.AddRange(list);
} }

Loading…
Cancel
Save