1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-10-15 23:50:54 +00:00

Performance improvements

This commit is contained in:
JKorf
2024-03-21 16:46:17 +01:00
parent db9fba4cf2
commit e86713e949
11 changed files with 80 additions and 24 deletions
@@ -192,9 +192,14 @@ namespace CryptoExchange.Net.Converters.SystemTextJson
[return: NotNullIfNotNull("enumValue")]
public static string? GetString<T>(T enumValue) => GetString(typeof(T), enumValue);
/// <summary>
/// Get the string value for an enum value using the MapAttribute mapping. When multiple values are mapped for a enum entry the first value will be returned
/// </summary>
/// <param name="objectType"></param>
/// <param name="enumValue"></param>
/// <returns></returns>
[return: NotNullIfNotNull("enumValue")]
private static string? GetString(Type objectType, object? enumValue)
public static string? GetString(Type objectType, object? enumValue)
{
objectType = Nullable.GetUnderlyingType(objectType) ?? objectType;