Restored outputting of candidates which failed some tests
This commit is contained in:
1 parent
afcc8d87f9
commit
5420523a0a
1 file changed
+1
-17
@@ -845,15 +845,12 @@ internal static class Program
|
||||
bool lastWasComposite = _lastCompositeP;
|
||||
bool primeFlag = false, printToConsole = false;
|
||||
|
||||
StringBuilder? localBuilder = passedAllTests ? StringBuilderPool.Rent() : null;
|
||||
if (localBuilder is not null)
|
||||
{
|
||||
StringBuilder localBuilder = StringBuilderPool.Rent();
|
||||
_ = localBuilder
|
||||
.Append(currentP).Append(',')
|
||||
.Append(searchedMersenne).Append(',')
|
||||
.Append(detailedCheck).Append(',')
|
||||
.Append(passedAllTests).Append('\n');
|
||||
}
|
||||
|
||||
lock (Sync)
|
||||
{
|
||||
@@ -868,8 +865,6 @@ internal static class Program
|
||||
_consoleCounter++;
|
||||
}
|
||||
|
||||
if (localBuilder is not null)
|
||||
{
|
||||
_ = _outputBuilder!.Append(localBuilder);
|
||||
|
||||
_writeIndex++;
|
||||
@@ -878,11 +873,8 @@ internal static class Program
|
||||
FlushBuffer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (printToConsole)
|
||||
{
|
||||
if (localBuilder is not null)
|
||||
{
|
||||
if (primeFlag)
|
||||
{
|
||||
@@ -894,18 +886,10 @@ internal static class Program
|
||||
|
||||
Console.WriteLine(localBuilder.Remove(localBuilder.Length - 1, 1).ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"{currentP},{searchedMersenne},{detailedCheck},{passedAllTests}");
|
||||
}
|
||||
}
|
||||
|
||||
if (localBuilder is not null)
|
||||
{
|
||||
localBuilder.Clear();
|
||||
StringBuilderPool.Return(localBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static void FlushBuffer()
|
||||
|
||||
Reference in new issue
Block a user