Skip to content

Commit 6d119fb

Browse files
i-kostikovKostikov Ilya
authored andcommitted
avoid boxing
1 parent 853d351 commit 6d119fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/UncommonField.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6+
using System.Collections.Generic;
67
using System.Diagnostics;
78

89
using MS.Internal.WindowsBase; // for FriendAccessAllowed
@@ -51,7 +52,7 @@ public void SetValue(DependencyObject instance, T value)
5152
EntryIndex entryIndex = instance.LookupEntry(_globalIndex);
5253

5354
// Set the value if it's not the default, otherwise remove the value.
54-
if (!object.ReferenceEquals(value, _defaultValue))
55+
if (!EqualityComparer<T>.Default.Equals(value, _defaultValue))
5556
{
5657
instance.SetEffectiveValue(entryIndex, null /* dp */, _globalIndex, null /* metadata */, value, BaseValueSourceInternal.Local);
5758
_hasBeenSet = true;

0 commit comments

Comments
 (0)