Skip to content

Commit

Permalink
refactor: cache typeof
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranayub committed Jun 13, 2024
1 parent a17ecd5 commit f70ea2d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions IGDB/Serialization/IdentityConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,15 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s
}
}

private static readonly string IdentitiesOrValuesName = typeof(IdentitiesOrValues<>).Name;
private static readonly string IdentityOrValueName = typeof(IdentityOrValue<>).Name;

public static bool IsIdentityOrValue(Type givenType) {
return givenType.Name.Contains(typeof(IdentityOrValue<>).Name);
return givenType.Name.Contains(IdentityOrValueName);
}

public static bool IsIdentitiesOrValues(Type givenType) {
return givenType.Name.Contains(typeof(IdentitiesOrValues<>).Name);
return givenType.Name.Contains(IdentitiesOrValuesName);
}
}

Expand Down

0 comments on commit f70ea2d

Please sign in to comment.