1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-12-25 13:29:59 +00:00

Fix MLC equality operator

This commit is contained in:
Andy McFadden 2024-07-20 13:05:50 -07:00
parent b946207e91
commit b6a5408fbc

View File

@ -994,7 +994,7 @@ namespace SourceGen {
return false; // one is null
}
return a.Text.Equals(b.Text) && a.BoxMode == b.BoxMode && a.MaxWidth == b.MaxWidth
&& a.BackgroundColor == b.BackgroundColor;
&& a.BackgroundColor == b.BackgroundColor && a.IsFancy == b.IsFancy;
}
public static bool operator !=(MultiLineComment a, MultiLineComment b) {
return !(a == b);
@ -1003,7 +1003,8 @@ namespace SourceGen {
return obj is MultiLineComment && this == (MultiLineComment)obj;
}
public override int GetHashCode() {
return Text.GetHashCode() ^ MaxWidth ^ (BoxMode ? 1 : 0) ^ BackgroundColor.GetHashCode();
return Text.GetHashCode() ^ MaxWidth ^ (BoxMode ? 1 : 0) ^ (IsFancy ? 2 : 0) ^
BackgroundColor.GetHashCode();
}
}
}