refactor: Removing redundant generic constraints

This commit is contained in:
Chris Cameron
2018-11-08 13:02:49 -05:00
parent 376f9c0837
commit cf0c71d39b

View File

@@ -148,7 +148,6 @@ namespace ICD.Common.Utils
/// <typeparam name="T"></typeparam> /// <typeparam name="T"></typeparam>
/// <returns></returns> /// <returns></returns>
public static IEnumerable<T> GetClassAttributes<T>() public static IEnumerable<T> GetClassAttributes<T>()
where T : Attribute
{ {
return s_AttributeToTypeCache.Select(kvp => kvp.Key) return s_AttributeToTypeCache.Select(kvp => kvp.Key)
.OfType<T>(); .OfType<T>();
@@ -162,7 +161,6 @@ namespace ICD.Common.Utils
/// <returns></returns> /// <returns></returns>
[CanBeNull] [CanBeNull]
public static T GetClassAttribute<T>(Type type) public static T GetClassAttribute<T>(Type type)
where T : Attribute
{ {
if (type == null) if (type == null)
throw new ArgumentNullException("type"); throw new ArgumentNullException("type");
@@ -177,7 +175,6 @@ namespace ICD.Common.Utils
/// <param name="type"></param> /// <param name="type"></param>
/// <returns></returns> /// <returns></returns>
public static IEnumerable<T> GetClassAttributes<T>(Type type) public static IEnumerable<T> GetClassAttributes<T>(Type type)
where T : Attribute
{ {
if (type == null) if (type == null)
throw new ArgumentNullException("type"); throw new ArgumentNullException("type");