fix: Adds optimized formatter for clilocs (#1045)

Adds an optimized formatter for localization. Example:
```cs
string localizationText = Localization.Format(1050039, "enu", $"{m_Amount}\t{LabelNumber:#}");
```

Fixes #1044
This commit is contained in:
Kamron Batman 2022-06-04 11:53:32 -07:00 committed by GitHub
parent ecbee17690
commit 5f00330a66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 248 additions and 53 deletions

View file

@ -127,6 +127,11 @@ public class STArrayPool<T> : ArrayPool<T>
buckets[i]?.Trim(ticks, pressure, GetMaxSizeForBucket(i));
}
if (_cacheBuckets == null)
{
return true;
}
// Under high pressure, release all cached buckets
if (pressure == MemoryPressure.High)
{