Compare commits

...

2 Commits

Author SHA1 Message Date
DrSmugleaf
72e0d24f7b Version: 248.0.3-source-gen-debug 2025-03-29 03:37:41 -07:00
DrSmugleaf
6ff060c7f6 Make MappingDataNode.Equals take 2952 times less time to run when loading maps (#5781) 2025-03-29 03:29:44 -07:00
3 changed files with 14 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
<Project>
<!-- This file automatically reset by Tools/version.py -->
<!-- This file automatically reset by Tools/version.py -->

View File

@@ -54,6 +54,9 @@ END TEMPLATE-->
*None yet*
## 248.0.3-source-gen-debug
## 248.0.2-source-gen-debug

View File

@@ -384,9 +384,16 @@ namespace Robust.Shared.Serialization.Markdown.Mapping
if (_children.Count != other._children.Count)
return false;
// Given that keys are unique and we do not care about the ordering, we know that if removing identical
// key-value pairs leaves us with an empty list then the mappings are equal.
return Except(other) == null && Tag == other.Tag;
foreach (var (key, otherValue) in other)
{
if (!_children.TryGetValue(key, out var ownValue) ||
!otherValue.Equals(ownValue))
{
return false;
}
}
return Tag == other.Tag;
}
public override MappingDataNode PushInheritance(MappingDataNode node)