Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjfrijters <jfrijters>2010-04-18 12:39:20 +0400
committerjfrijters <jfrijters>2010-04-18 12:39:20 +0400
commit6a1ca8dae9fe0ea6ec172d85de8f0f6d0e119a01 (patch)
tree91eb8f7d518f19e91fb234afaf20454f1e8d1418 /reflect/Type.cs
parenta2dd1781877bce23dcda08c4c85b37cdb91c6cf2 (diff)
Introduced Empty<T> to cache zero length arrays.
Diffstat (limited to 'reflect/Type.cs')
-rw-r--r--reflect/Type.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/reflect/Type.cs b/reflect/Type.cs
index 7f067b9a..f77a61d8 100644
--- a/reflect/Type.cs
+++ b/reflect/Type.cs
@@ -43,7 +43,7 @@ namespace IKVM.Reflection
public abstract class Type : MemberInfo, IGenericContext, IGenericBinder
{
- public static readonly Type[] EmptyTypes = new Type[0];
+ public static readonly Type[] EmptyTypes = Empty<Type>.Array;
public static Binder DefaultBinder
{
@@ -88,7 +88,7 @@ namespace IKVM.Reflection
public virtual MethodBase[] __GetDeclaredMethods()
{
- return MethodBase.EmptyArray;
+ return Empty<MethodBase>.Array;
}
public virtual __MethodImplMap __GetMethodImplMap()
@@ -98,17 +98,17 @@ namespace IKVM.Reflection
public virtual FieldInfo[] __GetDeclaredFields()
{
- return FieldInfo.EmptyArray;
+ return Empty<FieldInfo>.Array;
}
public virtual EventInfo[] __GetDeclaredEvents()
{
- return EventInfo.EmptyArray;
+ return Empty<EventInfo>.Array;
}
public virtual PropertyInfo[] __GetDeclaredProperties()
{
- return PropertyInfo.EmptyArray;
+ return Empty<PropertyInfo>.Array;
}
public virtual Type[] __GetRequiredCustomModifiers()
@@ -351,7 +351,7 @@ namespace IKVM.Reflection
return GetMember((string)cad.ConstructorArguments[0].Value);
}
}
- return new MemberInfo[0];
+ return Empty<MemberInfo>.Array;
}
public MemberInfo[] GetMember(string name)