Initial commit.

This commit is contained in:
Marek Lemańczyk committed 2025-09-09 21:15:57 +02:00
1 parent e5b0fea18c
commit 9f35f6c558
94 files changed
+12857

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
using System.Collections.Concurrent;
using System.Text;
namespace PerfectNumbers.Core;
public static class StringBuilderPool
{
private static readonly ConcurrentQueue<StringBuilder> _stringBuilderPool = new();
public static StringBuilder Rent() => _stringBuilderPool.TryDequeue(out var sb) ? sb : new();
public static void Return(StringBuilder sb)
{
_ = sb.Clear();
_stringBuilderPool.Enqueue(sb);
}
}