diff options
Diffstat (limited to 'src/mscorlib/src/System/Text/StringBuilderCache.cs')
-rw-r--r-- | src/mscorlib/src/System/Text/StringBuilderCache.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mscorlib/src/System/Text/StringBuilderCache.cs b/src/mscorlib/src/System/Text/StringBuilderCache.cs index 16a786d54e..a8a5e2c7f4 100644 --- a/src/mscorlib/src/System/Text/StringBuilderCache.cs +++ b/src/mscorlib/src/System/Text/StringBuilderCache.cs @@ -31,6 +31,7 @@ ** cache and return the resulting string ** ===========================================================*/ + using System.Threading; namespace System.Text @@ -47,14 +48,14 @@ namespace System.Text public static StringBuilder Acquire(int capacity = StringBuilder.DefaultCapacity) { - if(capacity <= MAX_BUILDER_SIZE) + if (capacity <= MAX_BUILDER_SIZE) { StringBuilder sb = StringBuilderCache.CachedInstance; if (sb != null) { // Avoid stringbuilder block fragmentation by getting a new StringBuilder // when the requested size is larger than the current capacity - if(capacity <= sb.Capacity) + if (capacity <= sb.Capacity) { StringBuilderCache.CachedInstance = null; sb.Clear(); |