Skip to content

Commit

Permalink
Merge pull request dotnet#5397 from dotnet-bot/from-tfs
Browse files Browse the repository at this point in the history
Merge changes from TFS
  • Loading branch information
MichalStrehovsky authored Feb 17, 2018
2 parents 0a541de + 68e8918 commit 69f53c6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ public sealed override Type FieldType
{
get
{
return this.FieldRuntimeType;
Type fieldType = _lazyFieldType;
if (fieldType == null)
{
_lazyFieldType = fieldType = this.FieldRuntimeType;
}

return fieldType;
}
}

Expand Down Expand Up @@ -292,6 +298,8 @@ protected RuntimeFieldInfo WithDebugName()

private volatile FieldAccessor _lazyFieldAccessor = null;

private volatile Type _lazyFieldType = null;

private String _debugName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,14 @@ public sealed override Type PropertyType
ReflectionTrace.PropertyInfo_PropertyType(this);
#endif

TypeContext typeContext = ContextTypeInfo.TypeContext;
return PropertyTypeHandle.Resolve(typeContext);
Type propertyType = _lazyPropertyType;
if (propertyType == null)
{
TypeContext typeContext = ContextTypeInfo.TypeContext;
_lazyPropertyType = propertyType = PropertyTypeHandle.Resolve(typeContext);
}

return propertyType;
}
}

Expand Down Expand Up @@ -402,6 +408,8 @@ private object GetConstantValue(bool raw)

private volatile ParameterInfo[] _lazyIndexParameters;

private volatile Type _lazyPropertyType;

private String _debugName;
}
}
Expand Down

0 comments on commit 69f53c6

Please sign in to comment.