Skip to content

Commit

Permalink
Use GetValueOrDefault instead of TryGetValue to get value from cache …
Browse files Browse the repository at this point in the history
…dictionary.
  • Loading branch information
Codespilot committed Sep 13, 2024
1 parent 81ab2b5 commit 70cdcf3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Euonia.Core/Reflection/PropertyAccessorCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ static PropertyAccessorCache()
}

/// <summary>
///
/// Get the lambda expression for the property.
/// </summary>
/// <param name="propertyName"></param>
/// <returns></returns>
public static LambdaExpression Get(string propertyName)
{
return _cache.TryGetValue(propertyName, out var result) ? result : null;
return _cache.GetValueOrDefault(propertyName);
}
}

0 comments on commit 70cdcf3

Please sign in to comment.