Skip to content

Commit

Permalink
oh like that
Browse files Browse the repository at this point in the history
  • Loading branch information
amylizzle committed Jan 16, 2025
1 parent 37f8194 commit d4d5ee8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions OpenDreamShared/Dream/ImmutableAppearance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public bool TryGetId([NotNullWhen(true)] out uint? id) {
return _registeredId is not null;
}

// ResSharper disable NonReadonlyMemberInGetHashCode
[SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")]
public override int GetHashCode() {
if(_storedHashCode is not null) //because everything is readonly, this only needs to be done once
return (int)_storedHashCode;
Expand Down Expand Up @@ -269,7 +269,6 @@ public override int GetHashCode() {
_storedHashCode = hashCode.ToHashCode();
return (int)_storedHashCode;
}
// ResSharper enable NonReadonlyMemberInGetHashCode

public ImmutableAppearance(NetIncomingMessage buffer, IRobustSerializer serializer) {
Overlays = [];
Expand Down
4 changes: 2 additions & 2 deletions OpenDreamShared/Dream/MutableAppearance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,9 @@ private static bool TryRepresentMatrixAsRgbaColor(in ColorMatrix matrix, [NotNul
return maybeColor is not null;
}

// ResSharper disable NonReadonlyMemberInGetHashCode

//it is *ESSENTIAL* that this matches the hashcode of the equivelant ImmutableAppearance. There's a debug assert and everything.
[SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")]
public override int GetHashCode() {
HashCode hashCode = new HashCode();

Expand Down Expand Up @@ -292,7 +293,6 @@ public override int GetHashCode() {

return hashCode.ToHashCode();
}
// ResSharper enable NonReadonlyMemberInGetHashCode

/// <summary>
/// Parses the given colour string and sets this appearance to use it.
Expand Down

0 comments on commit d4d5ee8

Please sign in to comment.