File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
src/CodeOfChaos.Extensions.ObjectPool Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ // ---------------------------------------------------------------------------------------------------------------------
2+ // Imports
3+ // ---------------------------------------------------------------------------------------------------------------------
4+ using Microsoft . Extensions . ObjectPool ;
5+ using System . Text ;
6+
7+ namespace CodeOfChaos . Extensions . ObjectPool ;
8+ // ---------------------------------------------------------------------------------------------------------------------
9+ // Code
10+ // ---------------------------------------------------------------------------------------------------------------------
11+ public class StringBuilderPoolPolicy : IPooledObjectPolicy < StringBuilder > {
12+ public StringBuilder Create ( ) => new ( ) ;
13+ public bool Return ( StringBuilder obj ) {
14+ obj . Clear ( ) ;
15+ return obj . Length == 0 ;
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments