Use EqualityComparer<T> to avoid boxing and casting when comparing.

This commit is contained in:
Huo Yaoyuan 2016-11-14 06:00:27 +08:00
parent 1d51e6af2a
commit 1cddc4eb5b
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ public virtual T DisplayedCount
}
protected set
{
if (displayedCount.Equals(value))
if (EqualityComparer<T>.Default.Equals(displayedCount, value))
return;
displayedCount = value;
DisplayedCountSpriteText.Text = FormatCount(value);