Skip to content

Commit a057813

Browse files
committed
Optimization
1 parent fd28dd8 commit a057813

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Helper/DataMetadataComparisonHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ public static Result<T> GetDifferences(HashSet<T> sourceList, HashSet<T> destina
8888
/// - <see cref="ValueTuple{T1,T2}.Item1"/> is a boolean indicating if any properties were edited.
8989
/// - <see cref="ValueTuple{T1,T2}.Item2"/> is a dictionary of updated properties for the edited entity.
9090
/// </returns>
91-
private static (bool isEdited, Dictionary<string, object> updatedProperties) GetEdited(T source, T destination, PropertyInfo[] compariableProperties)
91+
private static (bool isEdited, Dictionary<string, object>? updatedProperties) GetEdited(T source, T destination, PropertyInfo[] compariableProperties)
9292
{
93-
Dictionary<string, object> updatedProperties = new();
94-
bool isEdited = false;
9593
if (source.Equals(destination))
9694
{
97-
return (isEdited, updatedProperties);
95+
return (false, null);
9896
}
9997

98+
Dictionary<string, object> updatedProperties = new();
99+
bool isEdited = false;
100100
foreach (PropertyInfo prop in compariableProperties)
101101
{
102102
object sourceValue = prop.GetValue(source)!;

0 commit comments

Comments
 (0)