Skip to content

Commit d67843a

Browse files
committed
More cleanup
1 parent 9a83b26 commit d67843a

File tree

103 files changed

+335
-424
lines changed

Some content is hidden

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

103 files changed

+335
-424
lines changed

Src/FastData.Benchmarks/Benchmarks/AnalyzerBenchmarks.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Genbox.FastData.Internal.Analysis;
33
using Genbox.FastData.Internal.Analysis.Analyzers;
44
using Genbox.FastData.Internal.Analysis.Properties;
5-
using Genbox.FastData.InternalShared;
65
using Genbox.FastData.InternalShared.Helpers;
76
using Microsoft.Extensions.Logging.Abstractions;
87

@@ -17,7 +16,7 @@ public AnalyzerBenchmarks()
1716
{
1817
Random rng = new Random(42);
1918

20-
string[] data = Enumerable.Range(1, 100).Select(x => TestHelper.GenerateRandomString(rng, 50)).ToArray();
19+
string[] data = Enumerable.Range(1, 100).Select(_ => TestHelper.GenerateRandomString(rng, 50)).ToArray();
2120
StringProperties props = DataAnalyzer.GetStringProperties(data);
2221

2322
_analyzer = new GPerfAnalyzer(data, props, new GPerfAnalyzerConfig(), new Simulator(data, new SimulatorConfig()), NullLogger<GPerfAnalyzer>.Instance);

Src/FastData.Benchmarks/Benchmarks/DogsBenchmark.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,5 @@ public static bool Contains(string value)
2929
_ => false
3030
};
3131
}
32-
33-
public const int ItemCount = 3;
34-
public const int MinLength = 8;
35-
public const int MaxLength = 16;
3632
}
3733
}

Src/FastData.Benchmarks/Benchmarks/HashBenchmarks.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Genbox.FastData.Benchmarks.Benchmarks;
1010
[Orderer(SummaryOrderPolicy.FastestToSlowest)]
1111
public class HashBenchmarks
1212
{
13-
private string[] _array;
13+
private string[] _array = null!;
1414

1515
[Params(1_000, 10_000, 100_000, 1_000_000)]
1616
public int Size { get; set; }

Src/FastData.Benchmarks/Benchmarks/PerfectHashBenchmarks.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Genbox.FastData.Benchmarks.Benchmarks;
77
[Orderer(SummaryOrderPolicy.FastestToSlowest)]
88
public class PerfectHashBenchmarks
99
{
10-
private static ulong[] _hashCodes;
10+
private static ulong[] _hashCodes = null!;
1111

1212
[GlobalSetup]
1313
public void Setup()
@@ -27,7 +27,7 @@ public void Setup()
2727
"Wine", "Wood", "Word", "Work", "Year"
2828
];
2929

30-
_hashCodes = words.Select(x => (ulong)x.GetHashCode()).ToArray();
30+
_hashCodes = words.Select(x => (ulong)x.GetHashCode(StringComparison.Ordinal)).ToArray();
3131
}
3232

3333
[Benchmark]

Src/FastData.Benchmarks/Benchmarks/SegmentGeneratorsBenchmarks.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Genbox.FastData.Internal.Analysis;
22
using Genbox.FastData.Internal.Analysis.Properties;
33
using Genbox.FastData.Internal.Analysis.SegmentGenerators;
4-
using Genbox.FastData.InternalShared;
54
using Genbox.FastData.InternalShared.Helpers;
65

76
namespace Genbox.FastData.Benchmarks.Benchmarks;

Src/FastData.Benchmarks/Benchmarks/StringVsByteArrayVsInteger.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Runtime.CompilerServices;
22
using System.Text;
33
using BenchmarkDotNet.Order;
4-
using Genbox.FastData.InternalShared;
54
using Genbox.FastData.InternalShared.Helpers;
65

76
namespace Genbox.FastData.Benchmarks.Benchmarks;

Src/FastData.Generator.CPlusPlus.Shared/CPlusPlusCompiler.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,14 @@ private bool HasMSVC()
6060
if (!File.Exists(vsWherePath))
6161
return false;
6262

63-
using Process process = new Process
63+
using Process process = new Process();
64+
process.StartInfo = new ProcessStartInfo
6465
{
65-
StartInfo = new ProcessStartInfo
66-
{
67-
FileName = vsWherePath,
68-
Arguments = "-latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property productPath",
69-
UseShellExecute = false,
70-
RedirectStandardOutput = true,
71-
CreateNoWindow = true
72-
}
66+
FileName = vsWherePath,
67+
Arguments = "-latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property productPath",
68+
UseShellExecute = false,
69+
RedirectStandardOutput = true,
70+
CreateNoWindow = true
7371
};
7472

7573
process.Start();
@@ -80,7 +78,7 @@ private bool HasMSVC()
8078
return false;
8179

8280
//productPath points to LaunchDevCmd.bat which is not what we want. We want VsDevCmd.bat in the same folder
83-
_path = Path.Combine(Path.GetDirectoryName(productPath), "VsDevCmd.bat");
81+
_path = Path.Combine(Path.GetDirectoryName(productPath)!, "VsDevCmd.bat");
8482
return true;
8583
}
8684

Src/FastData.Generator.CPlusPlus.Tests/ExpressionCompilerTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using Genbox.FastData.Generator.CPlusPlus.Internal.Framework;
44
using Genbox.FastData.Generator.Framework;
55
using Genbox.FastData.InternalShared;
6-
using Genbox.FastData.InternalShared.TestClasses;
76
using Genbox.FastData.InternalShared.TestClasses.TheoryData;
87

98
namespace Genbox.FastData.Generator.CPlusPlus.Tests;

Src/FastData.Generator.CPlusPlus.Tests/Properties/ModuleInitializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Genbox.FastData.Generator.CPlusPlus.Tests.Properties;
55

6-
public static class ModuleInitializer
6+
internal static class ModuleInitializer
77
{
88
[ModuleInitializer]
99
public static void Initialize() => VerifyDiffPlex.Initialize(OutputType.Compact);

Src/FastData.Generator.CPlusPlus.Tests/VectorTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ int main(int argc, char* argv[])
4646
}
4747

4848
[SuppressMessage("Design", "CA1034:Nested types should not be visible")]
49+
[SuppressMessage("Maintainability", "CA1515:Consider making public types internal")]
50+
[SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")]
4951
public sealed class CPlusPlusContext
5052
{
5153
public CPlusPlusContext()

0 commit comments

Comments
 (0)