Improve performance and reduce memory use and reduce array allocations by reusing char[] (#9166)
* Reduce array allocations by reusing char[] * don't hide .Equals() * Reduce memory use by reducing array allocations * Revert "Reduce memory use by reducing array allocations" This reverts commit faf6b60234167f5443435243eb52187ab07d514c. * reuse char[] for string.split() to avoid params [] allocation
This commit is contained in:
@@ -446,7 +446,7 @@ namespace Umbraco.ModelsBuilder.Embedded.Building
|
||||
{
|
||||
WriteNonGenericClrType(sb, type.Substring(0, p));
|
||||
sb.Append("<");
|
||||
var args = type.Substring(p + 1).TrimEnd('>').Split(','); // fixme will NOT work with nested generic types
|
||||
var args = type.Substring(p + 1).TrimEnd(Umbraco.Core.Constants.CharArrays.GreaterThan).Split(Umbraco.Core.Constants.CharArrays.Comma); // fixme will NOT work with nested generic types
|
||||
for (var i = 0; i < args.Length; i++)
|
||||
{
|
||||
if (i > 0) sb.Append(", ");
|
||||
|
||||
Reference in New Issue
Block a user