Tiny cleanup
This commit is contained in:
1 parent
b3633d0a5c
commit
22be048c15
1 file changed
+3
-10
@@ -241,8 +241,9 @@ internal static class Program
|
|||||||
string header = string.IsNullOrWhiteSpace(headerLine) ? DefaultHeader : headerLine.Trim();
|
string header = string.IsNullOrWhiteSpace(headerLine) ? DefaultHeader : headerLine.Trim();
|
||||||
|
|
||||||
List<CandidateResult> candidates = LoadCandidates(reader, pMin, pMax, threadCount, bufferSize);
|
List<CandidateResult> candidates = LoadCandidates(reader, pMin, pMax, threadCount, bufferSize);
|
||||||
|
Console.WriteLine("Sorting...");
|
||||||
List<CandidateResult> sortedPrimeResults = ExtractSortedPrimeCandidates(candidates);
|
List<CandidateResult> sortedPrimeResults = ExtractSortedPrimeCandidates(candidates);
|
||||||
|
Console.WriteLine("Building primes list...");
|
||||||
List<CandidateResult> primeResults = BuildRawPrimeResults(candidates, sortedPrimeResults);
|
List<CandidateResult> primeResults = BuildRawPrimeResults(candidates, sortedPrimeResults);
|
||||||
|
|
||||||
string rawOutputPath = BuildOutputPath(inputPath, "raw-primes-");
|
string rawOutputPath = BuildOutputPath(inputPath, "raw-primes-");
|
||||||
@@ -682,15 +683,7 @@ internal static class Program
|
|||||||
{
|
{
|
||||||
public static readonly CandidateResultComparer Instance = new();
|
public static readonly CandidateResultComparer Instance = new();
|
||||||
|
|
||||||
public int Compare(CandidateResult x, CandidateResult y)
|
public int Compare(CandidateResult x, CandidateResult y) => x.P == y.P ? 0 : x.P < y.P ? -1 : 1;
|
||||||
{
|
|
||||||
if (x.P == y.P)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return x.P < y.P ? -1 : 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly struct ChunkResult
|
private readonly struct ChunkResult
|
||||||
|
|||||||
Reference in new issue
Block a user