Skip to content

Commit

Permalink
Enable NRT in LocalisableStringEqualityComparer
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Oct 10, 2024
1 parent f1d9fda commit a9d6738
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions osu.Framework/Localisation/LocalisableStringEqualityComparer.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

#nullable disable

using System;
using System.Collections.Generic;

Expand All @@ -17,14 +15,14 @@ public class LocalisableStringEqualityComparer : IEqualityComparer<LocalisableSt

public bool Equals(LocalisableString x, LocalisableString y)
{
object xData = x.Data;
object yData = y.Data;

if (ReferenceEquals(null, xData) != ReferenceEquals(null, yData))
return false;
object? xData = x.Data;
object? yData = y.Data;

if (ReferenceEquals(null, xData))
return true;
return ReferenceEquals(null, yData);

if (ReferenceEquals(null, yData))
return false;

if (xData.GetType() != yData.GetType())
return EqualityComparer<object>.Default.Equals(xData, yData);
Expand Down

0 comments on commit a9d6738

Please sign in to comment.