Skip to content

Commit 2337bd0

Browse files
committed
run inspection
1 parent 5b106f9 commit 2337bd0

File tree

6 files changed

+10
-20
lines changed

6 files changed

+10
-20
lines changed

ExpressionDebugger.Console/Program.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using ExpressionDebugger;
2-
using System;
1+
using System;
32
using System.Linq.Expressions;
43

54
namespace ExpressionDebugger.Console

ExpressionDebugger.Tests/DebugInfoInjectorTest.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Dynamic;
43
using System.Linq;
54
using System.Linq.Expressions;
65
using Microsoft.VisualStudio.TestTools.UnitTesting;
7-
using Microsoft.CSharp.RuntimeBinder;
86

9-
namespace ExpressionDebugger.Test
7+
namespace ExpressionDebugger.Tests
108
{
119
[TestClass]
1210
public class DebugInfoInjectorTest

ExpressionDebugger/ExpressionCompilationOptions.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32
using System.Reflection;
4-
using System.Text;
53

64
namespace ExpressionDebugger
75
{

ExpressionDebugger/ExpressionCompiler.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ public void AddFile(string code, string filename)
3232
var path = filename;
3333
if (_options?.EmitFile == true)
3434
{
35-
var root = _options?.RootPath;
36-
if (root == null)
37-
root = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "GeneratedSources");
35+
var root = _options?.RootPath
36+
?? Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "GeneratedSources");
3837
Directory.CreateDirectory(root);
3938
path = Path.Combine(root, filename);
4039
using (var fs = new FileStream(path, FileMode.Create))
@@ -126,7 +125,7 @@ from n in t.TypeNames
126125
}
127126

128127
assemblyStream.Seek(0, SeekOrigin.Begin);
129-
symbolsStream?.Seek(0, SeekOrigin.Begin);
128+
symbolsStream.Seek(0, SeekOrigin.Begin);
130129

131130
return AssemblyLoadContext.Default.LoadFromStream(assemblyStream, symbolsStream);
132131
}

ExpressionDebugger/ExpressionDebuggerExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using ExpressionDebugger;
22
using System.Diagnostics;
3-
using System.IO;
43
using System.Reflection;
5-
using System.Collections.Generic;
64

75
namespace System.Linq.Expressions
86
{

ExpressionTranslator/ExpressionTranslator.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Globalization;
34
#if !NETSTANDARD1_3
45
using System.Dynamic;
56
#endif
@@ -670,10 +671,7 @@ private Expression VisitConditional(ConditionalExpression node, bool shouldRetur
670671

671672
private Expression VisitConditionalBlock(ConditionalExpression node, bool shouldReturn, bool chain = false)
672673
{
673-
if (chain)
674-
WriteNextLine("else if (");
675-
else
676-
WriteNextLine("if (");
674+
WriteNextLine(chain ? "else if (" : "if (");
677675
Expression test = Visit(node.Test);
678676
Write(")");
679677
Indent();
@@ -756,7 +754,7 @@ private void WriteValue(object value)
756754
else if (double.IsNegativeInfinity(d))
757755
Write("double.NegativeInfinity");
758756
else
759-
Write(d.ToString(), "d");
757+
Write(d.ToString(CultureInfo.InvariantCulture), "d");
760758
}
761759
else if (value is float f)
762760
{
@@ -767,7 +765,7 @@ private void WriteValue(object value)
767765
else if (float.IsNegativeInfinity(f))
768766
Write("float.NegativeInfinity");
769767
else
770-
Write(f.ToString(), "f");
768+
Write(f.ToString(CultureInfo.InvariantCulture), "f");
771769
}
772770
else if (value is decimal || value is long || value is uint || value is ulong)
773771
{

0 commit comments

Comments
 (0)