Skip to content

Commit

Permalink
improve thread-safety
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Miller committed Mar 23, 2024
1 parent 44965df commit 4bbd9a4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Maui.DataGrid/Extensions/ReflectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ internal static class ReflectionExtensions
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static PropertyDescriptor? GetPropertyDescriptor(Type type, string propertyName)
{
if (!PropertyTypeCache.TryGetValue(type, out var properties))
{
properties = TypeDescriptor.GetProperties(type);
PropertyTypeCache[type] = properties;
}
var properties = PropertyTypeCache.GetOrAdd(type, TypeDescriptor.GetProperties);

return properties.Find(propertyName, false);
}
Expand Down

0 comments on commit 4bbd9a4

Please sign in to comment.