Skip to content

Reduce memory usage by Array.Empty #3085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ public virtual object ConvertFromString(string value, IValueSerializerContext co
throw GetConvertFromException(value);
}

static List<Type> Empty = new List<Type>();

/// <summary>
/// Returns an enumeration of the types referenced by the value serializer. If the value serializer asks for
/// a value serializer for System.Type, any types it asks to convert should be supplied in the returned
Expand All @@ -110,7 +108,7 @@ public virtual object ConvertFromString(string value, IValueSerializerContext co
/// <returns>An enumeration of the types converted by this serializer</returns>
public virtual IEnumerable<Type> TypeReferences(object value, IValueSerializerContext context)
{
return Empty;
return Array.Empty<Type>();
}

/// <summary>
Expand Down