Skip to content

Commit 700e22d

Browse files
committed
General code cleanup.
1 parent 58ec90f commit 700e22d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+468
-531
lines changed

ReClass.NET/AddressParser/DynamicCompiler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Diagnostics.Contracts;
33
using System.Linq.Expressions;
44
using System.Reflection;
@@ -92,7 +92,7 @@ private static Expression GenerateMethodBody(IExpression expression, Expression
9292
Expression.Condition(
9393
Expression.Equal(moduleVariable, Expression.Constant(null)),
9494
Expression.Constant(IntPtr.Zero),
95-
Expression.MakeMemberAccess(moduleVariable, typeof(Memory.Module).GetProperty(nameof(Memory.Module.Start)))
95+
Expression.MakeMemberAccess(moduleVariable, typeof(Memory.Module).GetProperty(nameof(Memory.Module.Start))!)
9696
)
9797
);
9898
}

ReClass.NET/AddressParser/ITokenizer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace ReClassNET.AddressParser
1+
namespace ReClassNET.AddressParser
22
{
33
public interface ITokenizer
44
{

ReClass.NET/AddressParser/Parser.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.IO;
33

44
namespace ReClassNET.AddressParser
@@ -185,10 +185,9 @@ private IExpression ParseLeaf()
185185

186186
public static IExpression Parse(string str)
187187
{
188-
using (var sr = new StringReader(str))
189-
{
190-
return Parse(new Tokenizer(sr));
191-
}
188+
using var sr = new StringReader(str);
189+
190+
return Parse(new Tokenizer(sr));
192191
}
193192

194193
private static IExpression Parse(ITokenizer tokenizer)

ReClass.NET/DataExchange/Scanner/CrySearchFile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Globalization;
44
using System.Text;
@@ -72,7 +72,7 @@ public IEnumerable<MemoryRecord> Load(string filePath, ILogger logger)
7272
switch (valueTypeStr)
7373
{
7474
default:
75-
case "8":
75+
// case "8":
7676
record.Encoding = Encoding.UTF8;
7777
break;
7878
case "9":

ReClass.NET/Debugger/RemoteDebugger.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Diagnostics.Contracts;
44
using System.Linq;
@@ -168,13 +168,11 @@ private List<BreakpointSplit> SplitBreakpoint(IntPtr address, int size)
168168
continue;
169169
}
170170
}
171-
if (size >= 1)
172-
{
173-
splits.Add(new BreakpointSplit { Address = address, Size = 1 });
174171

175-
address += 1;
176-
size -= 1;
177-
}
172+
splits.Add(new BreakpointSplit { Address = address, Size = 1 });
173+
174+
address += 1;
175+
size -= 1;
178176
}
179177

180178
return splits;

ReClass.NET/Extensions/RichTextBoxExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Drawing;
33
using System.Runtime.InteropServices;
44
using System.Windows.Forms;
@@ -16,7 +16,7 @@ public static void SetInnerMargin(this TextBoxBase textBox, int left, int top, i
1616
}
1717

1818
[StructLayout(LayoutKind.Sequential)]
19-
private struct RECT
19+
private readonly struct RECT
2020
{
2121
public readonly int Left;
2222
public readonly int Top;

ReClass.NET/Forms/ClassSelectionForm.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
3-
using System.Data;
43
using System.Diagnostics.Contracts;
54
using System.Linq;
65
using System.Windows.Forms;

ReClass.NET/Forms/EnumListForm.cs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Diagnostics.Contracts;
44
using System.Linq;
@@ -57,10 +57,9 @@ private void editEnumIconButton_Click(object sender, EventArgs e)
5757
return;
5858
}
5959

60-
using (var eef = new EnumEditorForm(@enum))
61-
{
62-
eef.ShowDialog();
63-
}
60+
using var eef = new EnumEditorForm(@enum);
61+
62+
eef.ShowDialog();
6463
}
6564

6665
private void addEnumIconButton_Click(object sender, EventArgs e)
@@ -70,14 +69,13 @@ private void addEnumIconButton_Click(object sender, EventArgs e)
7069
Name = "Enum"
7170
};
7271

73-
using (var eef = new EnumEditorForm(@enum))
72+
using var eef = new EnumEditorForm(@enum);
73+
74+
if (eef.ShowDialog() == DialogResult.OK)
7475
{
75-
if (eef.ShowDialog() == DialogResult.OK)
76-
{
77-
project.AddEnum(@enum);
76+
project.AddEnum(@enum);
7877

79-
ShowFilteredEnums();
80-
}
78+
ShowFilteredEnums();
8179
}
8280
}
8381

ReClass.NET/Forms/EnumSelectionForm.cs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Diagnostics.Contracts;
44
using System.Linq;
@@ -57,10 +57,9 @@ private void editEnumIconButton_Click(object sender, EventArgs e)
5757
return;
5858
}
5959

60-
using (var eef = new EnumEditorForm(@enum))
61-
{
62-
eef.ShowDialog();
63-
}
60+
using var eef = new EnumEditorForm(@enum);
61+
62+
eef.ShowDialog();
6463
}
6564

6665
private void addEnumIconButton_Click(object sender, EventArgs e)
@@ -70,14 +69,13 @@ private void addEnumIconButton_Click(object sender, EventArgs e)
7069
Name = "Enum"
7170
};
7271

73-
using (var eef = new EnumEditorForm(@enum))
72+
using var eef = new EnumEditorForm(@enum);
73+
74+
if (eef.ShowDialog() == DialogResult.OK)
7475
{
75-
if (eef.ShowDialog() == DialogResult.OK)
76-
{
77-
project.AddEnum(@enum);
76+
project.AddEnum(@enum);
7877

79-
ShowFilteredEnums();
80-
}
78+
ShowFilteredEnums();
8179
}
8280
}
8381

ReClass.NET/Forms/FoundCodeForm.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Data;
33
using System.Diagnostics.Contracts;
44
using System.Drawing;
@@ -10,7 +10,6 @@
1010
using ReClassNET.Memory;
1111
using ReClassNET.Nodes;
1212
using ReClassNET.UI;
13-
using ReClassNET.Util;
1413

1514
namespace ReClassNET.Forms
1615
{

0 commit comments

Comments
 (0)